feat!: migrate android-maps-ktx into android-maps-utils (v6.0.0) - #1716
Conversation
…1716) - Consolidate Kotlin Extensions (KTX into Utils): Move all reactive Coroutine/Flow extensions (awaitMap, mapClickEvents, cameraMoveEvents) and option builder DSLs (addMarker, addPolyline, addPolygon) from android-maps-ktx directly into android-maps-utils. - Canonical Non-KTX Packages: Place all reactive Coroutine/Flow extensions and DSL builders in canonical com.google.maps.android.* packages. - Deprecated Compatibility Layer: Preserve the legacy com.google.maps.android.ktx.* package structure with @deprecated(level = DeprecationLevel.WARNING, replaceWith = ReplaceWith(...)) forwarding wrappers and typealiases so existing imports compile seamlessly with deprecation warnings. - Multi-Module Integration: Integrate KTX extensions across :library, :clustering, :heatmaps, and :data modules. - Demo & Test Consolidation: Include KtxExtensionsDemoActivity in :demo and integrate all 18 KTX unit test suites with both canonical and shim test coverage.
d5b5d7a to
f4a5753
Compare
…1716) - Consolidate Kotlin Extensions (KTX into Utils): Move all reactive Coroutine/Flow extensions (awaitMap, mapClickEvents, cameraMoveEvents) and option builder DSLs (addMarker, addPolyline, addPolygon) from android-maps-ktx directly into android-maps-utils. - Canonical Non-KTX Packages: Place all reactive Coroutine/Flow extensions and DSL builders in canonical com.google.maps.android.* packages. - Deprecated Compatibility Layer: Preserve the legacy com.google.maps.android.ktx.* package structure with @deprecated(level = DeprecationLevel.WARNING, replaceWith = ReplaceWith(...)) forwarding wrappers and typealiases so existing imports compile seamlessly with deprecation warnings. - Multi-Module Integration: Integrate KTX extensions across :library, :clustering, :heatmaps, and :data modules. - Demo & Test Consolidation: Include KtxExtensionsDemoActivity in :demo and integrate all 18 KTX unit test suites with both canonical and shim test coverage.
f4a5753 to
407fded
Compare
…1716) - Consolidate Kotlin Extensions (KTX into Utils): Move all reactive Coroutine/Flow extensions (awaitMap, mapClickEvents, cameraMoveEvents) and option builder DSLs (addMarker, addPolyline, addPolygon) from android-maps-ktx directly into android-maps-utils. - Canonical Non-KTX Packages: Place all reactive Coroutine/Flow extensions and DSL builders in canonical com.google.maps.android.* packages. - Deprecated Compatibility Layer: Preserve the legacy com.google.maps.android.ktx.* package structure with @deprecated(level = DeprecationLevel.WARNING, replaceWith = ReplaceWith(...)) forwarding wrappers and typealiases so existing imports compile seamlessly with deprecation warnings. - Multi-Module Integration: Integrate KTX extensions across :library, :clustering, :heatmaps, and :data modules. - Demo & Test Consolidation: Include KtxExtensionsDemoActivity in :demo and integrate all 18 KTX unit test suites with both canonical and shim test coverage.
407fded to
96b0801
Compare
…1716) - Consolidate Kotlin Extensions (KTX into Utils): Move all reactive Coroutine/Flow extensions (awaitMap, mapClickEvents, cameraMoveEvents) and option builder DSLs (addMarker, addPolyline, addPolygon) from android-maps-ktx directly into android-maps-utils. - Canonical Non-KTX Packages: Place all reactive Coroutine/Flow extensions and DSL builders in canonical com.google.maps.android.* packages. - Deprecated Compatibility Layer: Preserve the legacy com.google.maps.android.ktx.* package structure with @deprecated(level = DeprecationLevel.WARNING, replaceWith = ReplaceWith(...)) forwarding wrappers and typealiases so existing imports compile seamlessly with deprecation warnings. - Multi-Module Integration: Integrate KTX extensions across :library, :clustering, :heatmaps, and :data modules. - Demo & Test Consolidation: Include KtxExtensionsDemoActivity in :demo and integrate all 18 KTX unit test suites with both canonical and shim test coverage.
96b0801 to
ff8f979
Compare
…1716) - Consolidate Kotlin Extensions (KTX into Utils): Move all reactive Coroutine/Flow extensions (awaitMap, mapClickEvents, cameraMoveEvents) and option builder DSLs (addMarker, addPolyline, addPolygon) from android-maps-ktx directly into android-maps-utils. - Canonical Non-KTX Packages: Place all reactive Coroutine/Flow extensions and DSL builders in canonical com.google.maps.android.* packages. - Deprecated Compatibility Layer: Preserve the legacy com.google.maps.android.ktx.* package structure with @deprecated(level = DeprecationLevel.WARNING, replaceWith = ReplaceWith(...)) forwarding wrappers and typealiases so existing imports compile seamlessly with deprecation warnings. - Multi-Module Integration: Integrate KTX extensions across :library, :clustering, :heatmaps, and :data modules. - Demo & Test Consolidation: Include KtxExtensionsDemoActivity in :demo and integrate all 18 KTX unit test suites with both canonical and shim test coverage.
d00d357 to
f1a4793
Compare
…1716) - Consolidate Kotlin Extensions (KTX into Utils): Move all reactive Coroutine/Flow extensions (awaitMap, mapClickEvents, cameraMoveEvents) and option builder DSLs (addMarker, addPolyline, addPolygon) from android-maps-ktx directly into android-maps-utils. - Canonical Non-KTX Packages: Place all reactive Coroutine/Flow extensions and DSL builders in canonical com.google.maps.android.* packages. - Deprecated Compatibility Layer: Preserve the legacy com.google.maps.android.ktx.* package structure with @deprecated(level = DeprecationLevel.WARNING, replaceWith = ReplaceWith(...)) forwarding wrappers and typealiases so existing imports compile seamlessly with deprecation warnings. - Multi-Module Integration: Integrate KTX extensions across :library, :clustering, :heatmaps, and :data modules. - Demo & Test Consolidation: Include KtxExtensionsDemoActivity in :demo and integrate all 18 KTX unit test suites with both canonical and shim test coverage.
5cdce08 to
3ce966a
Compare
…1716) - Consolidate Kotlin Extensions (KTX into Utils): Move all reactive Coroutine/Flow extensions (awaitMap, mapClickEvents, cameraMoveEvents) and option builder DSLs (addMarker, addPolyline, addPolygon) from android-maps-ktx directly into android-maps-utils. - Canonical Non-KTX Packages: Place all reactive Coroutine/Flow extensions and DSL builders in canonical com.google.maps.android.* packages. - Deprecated Compatibility Layer: Preserve the legacy com.google.maps.android.ktx.* package structure with @deprecated(level = DeprecationLevel.WARNING, replaceWith = ReplaceWith(...)) forwarding wrappers and typealiases so existing imports compile seamlessly with deprecation warnings. - Multi-Module Integration: Integrate KTX extensions across :library, :clustering, :heatmaps, and :data modules. - Demo & Test Consolidation: Include KtxExtensionsDemoActivity in :demo and integrate all 18 KTX unit test suites with both canonical and shim test coverage.
3ce966a to
5f6c90f
Compare
…1716) - Consolidate Kotlin Extensions (KTX into Utils): Move all reactive Coroutine/Flow extensions (awaitMap, mapClickEvents, cameraMoveEvents) and option builder DSLs (addMarker, addPolyline, addPolygon) from android-maps-ktx directly into android-maps-utils. - Canonical Non-KTX Packages: Place all reactive Coroutine/Flow extensions and DSL builders in canonical com.google.maps.android.* packages. - Deprecated Compatibility Layer: Preserve the legacy com.google.maps.android.ktx.* package structure with @deprecated(level = DeprecationLevel.WARNING, replaceWith = ReplaceWith(...)) forwarding wrappers and typealiases so existing imports compile seamlessly with deprecation warnings. - Multi-Module Integration: Integrate KTX extensions across :library, :clustering, :heatmaps, and :data modules. - Demo & Test Consolidation: Include KtxExtensionsDemoActivity in :demo and integrate all 18 KTX unit test suites with both canonical and shim test coverage.
5f6c90f to
a2164ec
Compare
…1716) - Consolidate Kotlin Extensions (KTX into Utils): Move all reactive Coroutine/Flow extensions (awaitMap, mapClickEvents, cameraMoveEvents) and option builder DSLs (addMarker, addPolyline, addPolygon) from android-maps-ktx directly into android-maps-utils. - Canonical Non-KTX Packages: Place all reactive Coroutine/Flow extensions and DSL builders in canonical com.google.maps.android.* packages. - Deprecated Compatibility Layer: Preserve the legacy com.google.maps.android.ktx.* package structure with @deprecated(level = DeprecationLevel.WARNING, replaceWith = ReplaceWith(...)) forwarding wrappers and typealiases so existing imports compile seamlessly with deprecation warnings. - Multi-Module Integration: Integrate KTX extensions across :library, :clustering, :heatmaps, and :data modules. - Demo & Test Consolidation: Include KtxExtensionsDemoActivity in :demo and integrate all 18 KTX unit test suites with both canonical and shim test coverage.
a2164ec to
a0a837d
Compare
36d824a to
17beee0
Compare
| * for multi-observer configurations. | ||
| */ | ||
| @RequiresPermission(Manifest.permission.ACCESS_COARSE_LOCATION) | ||
| public fun LocationManager.coarseLocationEvents( |
There was a problem hiding this comment.
Falling back to PASSIVE_PROVIDER here will throw a SecurityException if the caller only holds ACCESS_COARSE_LOCATION, since Android's LocationManagerService strictly requires ACCESS_FINE_LOCATION for passive updates. Also, we should check allProviders.contains(...) before calling requestLocationUpdates in both coarseLocationEvents and fineLocationEvents (and close() the flow if missing) so this doesn't crash with IllegalArgumentException: provider doesn't exist on devices without GPS/network hardware.
There was a problem hiding this comment.
Great catch! Fixed in 7429314c — removed the PASSIVE_PROVIDER fallback in coarseLocationEvents and added an upfront if (!allProviders.contains(...)) { close(); return@callbackFlow } check in both coarseLocationEvents (NETWORK_PROVIDER) and fineLocationEvents (GPS_PROVIDER), along with unit tests in LocationManagerTest verifying that missing providers complete the flow cleanly without invoking requestLocationUpdates.
…1716) - Consolidate Kotlin Extensions (KTX into Utils): Move all reactive Coroutine/Flow extensions (awaitMap, mapClickEvents, cameraMoveEvents) and option builder DSLs (addMarker, addPolyline, addPolygon) from android-maps-ktx directly into android-maps-utils. - Canonical Non-KTX Packages: Place all reactive Coroutine/Flow extensions and DSL builders in canonical com.google.maps.android.* packages. - Deprecated Compatibility Layer: Preserve the legacy com.google.maps.android.ktx.* package structure with @deprecated(level = DeprecationLevel.WARNING, replaceWith = ReplaceWith(...)) forwarding wrappers and typealiases so existing imports compile seamlessly with deprecation warnings. - Multi-Module Integration: Integrate KTX extensions across :library, :clustering, :heatmaps, and :data modules. - Demo & Test Consolidation: Include KtxExtensionsDemoActivity in :demo and integrate all 18 KTX unit test suites with both canonical and shim test coverage.
…aps-ktx - Add canonical Context.awaitMapsSdkInitialized(preferredRenderer) suspending extension in com.google.maps.android. - Add deprecated backward-compatibility shim in com.google.maps.android.ktx. - Add canonical and shim unit test suites for MapsInitializer coroutine extensions. - Showcase awaitMapsSdkInitialized in KtxExtensionsDemoActivity and register demo in MainActivity. - Update README.md documentation with awaitMapsSdkInitialized usage example.
…me for unit tests
…nd add adversarial tests
e7d9d13 to
7dbc806
Compare
) * fix: resolve 10 defects uncovered by Android Maps Testing Toolkit Fixes 10 production issues across `:data`, `:heatmaps`, `:clustering`, `:library`, and `:ui` uncovered by deterministic JVM and visual testing with Android Maps Testing Toolkit v1.1.0-rc01: 1. `:data` (`KmlLayer`): Cache `KmlGroundOverlay -> ModelFeature` in `mGroundOverlayMap` so `removeLayerFromMap()` removes ground overlays from `MapViewRenderer`'s `IdentityHashMap` instead of leaking them. 2. `:data` (`Style`, `MapViewRenderer`, `GeoJsonLayer`, `KmlLayer`): Propagate `clickable` (defaulting to `true`) and `visible` to `PolylineOptions` and `PolygonOptions` so GeoJSON and KML polygons and polylines dispatch `OnFeatureClickListener` callbacks. 3. `:data` (`GeoJsonLayer`, `KmlLayer`, `MapViewRenderer`): Route markers, polygons, polylines, and ground overlays through passed-in `MarkerManager`, `PolygonManager`, `PolylineManager`, and `GroundOverlayManager` collections when provided, and register click listeners on those collections instead of clobbering global `GoogleMap` click listeners. 4. `:data` (`KmlLayer`, `GeoJsonLayer`, `Style`, `MapViewRenderer`): Aggregate placemarks and ground overlays from `<Document>` containers in `hasPlacemarks()`, `getPlacemarks()`, `features`, and `getGroundOverlays()`, and preserve styles on `MultiGeometry` features via `CompositeStyle`. 5. `:data` (`GeoJsonLayer`, `Style`, `MapViewRenderer`): Propagate `GeoJsonPointStyle` `title`, `snippet`, `isDraggable`, `isFlat`, `isVisible`, `infoWindowAnchorU/V`, and custom `icon` (`BitmapDescriptor`) to `MarkerOptions` and `AdvancedMarkerOptions`. 6. `:heatmaps` (`HeatmapTileProvider`): Clamp `zoom` when indexing `maxIntensity` (preventing `ArrayIndexOutOfBoundsException` at zoom level 22) and clamp `bucketX`/`bucketY` to `0 until gridDim` so points on the inclusive upper boundary `maxX`/`maxY` do not throw `ArrayIndexOutOfBoundsException`. 7. `:heatmaps` (`HeatmapTileProvider`): Check `&& wrappedPoints.isEmpty()` before returning `TileProvider.NO_TILE` so cross-antimeridian points render across the International Date Line, and enforce `MIN_RADIUS..MAX_RADIUS` and `0.0..1.0` bounds validation in `setRadius` and `setOpacity`. 8. `:clustering` (`DefaultClusterRenderer`): Clear stale `marker.title` and `marker.snippet` when a `ClusterItem`'s title/snippet is updated to `null`, and update `marker.zIndex` in `onClusterItemUpdated` even when `position` is unchanged. 9. `:library` (`MapObjectManager`): Invoke `setListenersOnUiThread()` synchronously when constructed on the main thread instead of unconditionally posting to the back of the main looper queue. 10. `:ui` (`AnimationUtil`, `IconGenerator`, `RotationLayout`): Snap directly to `finalPosition` when `durationInMs <= 0L` (avoiding `0 / 0.0f = NaN`), clamp `t` to `[0f, 1f]` so `AccelerateDecelerateInterpolator` never rebounds on frame overshoot, and use `degrees.mod(360)` so negative multi-turn rotations do not throw `IllegalStateException`. * fix: address PR review comments on layer managers, KML accessors, Style, and cluster renderers
… (.api dumps) (#1800) * chore: enable Kotlin explicitApi() and Binary Compatibility Validator (.api dumps) - Enable kotlin explicitApi() across published modules (:library, :clustering, :data, :heatmaps, :ui) - Add explicit public visibility and return types to all public Kotlin symbols across modules - Configure Binary Compatibility Validator (BCV) for AGP 9.3 via build-logic convention plugin and root aggregate tasks - Generate and commit baseline .api dumps for :library, :clustering, :data, :heatmaps, and :ui - Add apiCheck to the CI Pull Request test workflow Fixes #1794 * fix: restore public visibility on ResponseStreetView and update library.api
Summary
Migrates all Kotlin extensions from
android-maps-ktx(maps-ktxandmaps-utils-ktx) directly intoandroid-maps-utils, establishingv6.0.0as the consolidated, single-source release for both Java utilities and Kotlin Coroutine/Flow extensions.Key Changes
awaitMap(),awaitMapsSdkInitialized(),awaitAnimateCamera()).Flowevent streams (mapClickEvents(),cameraMoveEvents(),markerClickEvents()).addMarker { ... },addPolyline { ... },addPolygon { ... }).com.google.maps.android.*packages.com.google.maps.android.ktx.*with@Deprecated(level = DeprecationLevel.WARNING)forwarding wrappers and typealiases for seamless backward compatibility.release-please-config.jsonand.release-please-manifest.jsonfor finalv6.0.0stable release.README.md,MIGRATION.md,llm-integration-prompt.md,.gemini/skills/android-maps-utils/SKILL.md).main(e8ef093c, Kover migration).:library,:clustering,:data,:heatmaps,:ui,:demo).