KEMBAR78
Comparing v6.9.0...v6.10.0 · googlemaps/android-maps-compose · GitHub
Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: googlemaps/android-maps-compose
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.9.0
Choose a base ref
...
head repository: googlemaps/android-maps-compose
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.10.0
Choose a head ref
  • 2 commits
  • 11 files changed
  • 2 contributors

Commits on Sep 9, 2025

  1. feat: Introduce a robust Google Maps initializer (#758)

    * feat: Introduce a robust Google Maps initializer
    
    This commit refactors the map initialization logic to be more robust and
    test-friendly.
    
    Previously, the map initialization was coupled with the attribution ID
    logic, which made it difficult to handle initialization failures,
    especially in test environments where the Maps SDK might be mocked.
    
    This change introduces a new `GoogleMapsInitializer` object that manages
    the initialization process with a state machine. This provides more
    control over the initialization process and allows for better error
    handling.
    
    The key changes are:
    
    - A new `GoogleMapsInitializer` object that manages the initialization
      of the Google Maps SDK.
    - An `InitializationState` enum that represents the different states of
      the initialization process.
    - An `initialize` function that starts the initialization process on a
      background thread.
    - A `reset` function that allows for re-initialization in test
      environments.
    - The `GoogleMap` composable now uses the `GoogleMapsInitializer` to
      ensure that the map is only displayed after the SDK has been
      successfully initialized.
    
    * chore: address copyright header issues
    
    * refactor: Make GoogleMapsInitializer suspendable
    
    This change refactors the `GoogleMapsInitializer` to use suspend functions for initialization and reset operations, improving its testability and adherence to structured concurrency.
    
    Key changes:
    - Converted `GoogleMapsInitializer.initialize()` and `GoogleMapsInitializer.reset()` to `suspend` functions.
    - Removed the internal `CoroutineScope` and job management from `GoogleMapsInitializer`.
    - Updated unit and instrumentation tests to use `runTest` from `kotlinx-coroutines-test`, removing the need for `Thread.sleep()`.
    - Added the `kotlinx-coroutines-test` dependency to the `maps-app` module.
    
    * refactor(maps-compose): Make GoogleMapsInitializer fully suspending
    
    The `initialize` function has been refactored to be a fully suspending operation.
    
    Key changes:
    - Replaced `launch(Dispatchers.IO)` with `withContext(Dispatchers.IO)`. This ensures the `initialize` function suspends until the blocking initialization call is complete, rather than returning immediately.
    - Added explicit handling for non-SUCCESS results from `MapsInitializer.initialize()` to set the state to `FAILURE`.
    - Restructured the `try-catch` block to correctly handle exceptions from the `withContext` block.
    
    * chore: Update Material, Robolectric, and Truth dependencies
    
    * test: Add StrictMode check to GoogleMapsInitializerTest
    
    Wraps the `GoogleMapsInitializer.initialize()` call with strict
    StrictMode policies. This ensures the initialization process does not
    perform any violations, such as disk reads, which would cause the
    test to fail.
    
    * test: Refactor GoogleMapViewTests to use Truth assertions
    
    Key changes:
    - Introduced a custom `LatLngSubject` for the Truth assertion library to allow for `LatLng` comparisons with a tolerance.
    - Migrated assertions in `GoogleMapViewTests` from JUnit to Truth for improved readability and more expressive tests.
    - Added explicit Google Maps SDK initialization within the test setup.
    
    * chore: add license headers to test files
    dkhawk authored Sep 9, 2025
    Configuration menu
    Copy the full SHA
    87a4b5c View commit details
    Browse the repository at this point in the history
  2. chore(release): 6.10.0 [skip ci]

    # [6.10.0](v6.9.0...v6.10.0) (2025-09-09)
    
    ### Features
    
    * Introduce a robust Google Maps initializer ([#758](#758)) ([87a4b5c](87a4b5c))
    semantic-release-bot committed Sep 9, 2025
    Configuration menu
    Copy the full SHA
    9293ad0 View commit details
    Browse the repository at this point in the history
Loading