Modern Apps git

← Modern-Apps.git

library: remove map-to-network edge via online injection (#884)

Commit
d6e8a464bc21cbbb629152ae39bfd069d880bfd3
Author
Vayun Mathur <[email protected]>
When
2026-10-31 19:24 UTC (1 month ago)
Parents
aa66835
:library:map depended on :library:network for ConnectivityMonitor, and
the guard allowlisted it on the theory that map already declares
INTERNET so nothing leaks. The owner rejects that reasoning: a
permission-using library (network declares ACCESS_NETWORK_STATE) must
not be used by another library, period — the edge also drags the whole
network API surface onto every map consumer's classpath.

Root cause: VulkanMapSurface read the monitor directly. The fix injects
it: VectorMap gains an online: StateFlow<Boolean> param (defaulting to a
constant-true flow that preserves the old probe's optimistic behaviour
for hosts without a signal), forwarded to VulkanMapSurface, which seeds
renderer.setOnline from online.value and collects it. The Rust tile
fetcher is unaffected: it resolves NativeHttpBridge
(com.vayunmathur.library.network) at runtime via FindClass from the host
app's classpath, and all nine map hosts already depend on
:library:network directly — so pmtiles range fetches keep the reduced CA
bundle and HttpURLConnection-only policy with no compile edge and no
second TLS stack. Hosts with network (maps, taxi x3, travel, weather,
fooddelivery, findfamily) pass ConnectivityMonitor.isOnline, keeping the
NET_CAPABILITY_VALIDATED semantics; photos keeps the default (offline-
first gallery, local photos plus cached tiles).

Collateral the move exposed: photos, openassistant and launcher used
OfflineAware/rememberIsOnline from :library:network without depending on
it (they only compiled while :library:ui re-exported the edge). Each now
pays its own way: photos and openassistant drop the banner (both are
offline-first; download gating already surfaces offline state), and the
launcher TV clock header gains a local validated-internet signal with the
same semantics, covered by the ACCESS_NETWORK_STATE its own manifest
already declares.

User-visible effect: none intended — tile online/offline policy and the
remaining banners behave exactly as before.

Verification: :library:map compileDebugKotlin plus :maps :taxi :travel
:weather :findfamily :photos :fooddelivery :openassistant :launcher
compileDevKotlin green in one invocation.

Diff

findfamily/src/main/java/com/vayunmathur/findfamily/ui/MapView.kt
diff --git a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MapView.kt b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MapView.ktindex 563d835967..23fb54606a 100644--- a/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MapView.kt+++ b/findfamily/src/main/java/com/vayunmathur/findfamily/ui/MapView.kt@@ -52,6 +52,7 @@ import com.vayunmathur.library.map.GeoPoint import com.vayunmathur.library.map.GestureOptions import com.vayunmathur.library.map.MapOptions import com.vayunmathur.library.map.VectorMap+import com.vayunmathur.library.util.ConnectivityMonitor import kotlin.io.encoding.Base64 import kotlin.math.abs import kotlin.math.cos@@ -108,6 +109,7 @@ fun MapView(                 zoomRange = 0f..20f,                 options = MapOptions(gestureOptions = GestureOptions.TiltLocked),                 onMapClick = { onMapClick() },+                online = ConnectivityMonitor.isOnline,             ) {                 if (initialized) {                     // The coordinate at the screen centre — i.e. the live position of
fooddelivery/src/main/java/com/vayunmathur/fooddelivery/ui/OrderTrackingScreen.kt
diff --git a/fooddelivery/src/main/java/com/vayunmathur/fooddelivery/ui/OrderTrackingScreen.kt b/fooddelivery/src/main/java/com/vayunmathur/fooddelivery/ui/OrderTrackingScreen.ktindex 6a9b036fa1..84f5e6d454 100644--- a/fooddelivery/src/main/java/com/vayunmathur/fooddelivery/ui/OrderTrackingScreen.kt+++ b/fooddelivery/src/main/java/com/vayunmathur/fooddelivery/ui/OrderTrackingScreen.kt@@ -40,6 +40,7 @@ import com.vayunmathur.library.map.MapOptions import com.vayunmathur.library.map.VectorMap import com.vayunmathur.library.map.rememberCameraState import com.vayunmathur.library.ui.AppScaffold+import com.vayunmathur.library.util.ConnectivityMonitor import com.vayunmathur.library.ui.Button import com.vayunmathur.library.ui.Card import com.vayunmathur.library.ui.CircularProgressIndicator@@ -227,7 +228,7 @@ private fun TrackingMap(order: Order, modifier: Modifier = Modifier) {     }      Box(modifier) {-        VectorMap(cameraState = camera, options = MapOptions(gestureOptions = GestureOptions.TiltLocked)) {+        VectorMap(cameraState = camera, options = MapOptions(gestureOptions = GestureOptions.TiltLocked), online = ConnectivityMonitor.isOnline) {             // Distinct glyph per pin: menu = restaurant, arrow = courier, home = you.             restaurant?.let {                 MapMarker(it) { PinChrome(MaterialTheme.colorScheme.tertiary) { IconRestaurant() } }
launcher/src/main/java/com/vayunmathur/launcher/tv/ui/TvClockHeader.kt
diff --git a/launcher/src/main/java/com/vayunmathur/launcher/tv/ui/TvClockHeader.kt b/launcher/src/main/java/com/vayunmathur/launcher/tv/ui/TvClockHeader.ktindex 766b95f158..6303ff68ed 100644--- a/launcher/src/main/java/com/vayunmathur/launcher/tv/ui/TvClockHeader.kt+++ b/launcher/src/main/java/com/vayunmathur/launcher/tv/ui/TvClockHeader.kt@@ -1,5 +1,9 @@ package com.vayunmathur.launcher.tv.ui +import android.content.Context+import android.net.ConnectivityManager+import android.net.Network+import android.net.NetworkCapabilities import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box@@ -9,7 +13,9 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.runtime.Composable+import androidx.compose.runtime.State import androidx.compose.runtime.getValue+import androidx.compose.runtime.produceState import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color@@ -24,7 +30,6 @@ import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.Text import com.vayunmathur.library.ui.rememberClock import com.vayunmathur.library.ui.rememberIs24Hour-import com.vayunmathur.library.util.rememberIsOnline import kotlin.time.Duration.Companion.seconds import kotlin.time.Instant import kotlinx.datetime.TimeZone@@ -97,7 +102,11 @@ private fun timeLabel(nowMillis: Long, is24Hour: Boolean): String { private fun TvNetworkTile(     onOpenNetworkSettings: () -> Unit, ) {-    val online by rememberIsOnline()+    // Local validated-internet signal (not ConnectivityMonitor: the launcher+    // takes no :library:network dependency, and the monitor UI lives there —+    // importing it would reintroduce the #884 permission leak. ACCESS_WIFI_STATE+    // / ACCESS_NETWORK_STATE are declared by this app's own manifest).+    val online by rememberLauncherOnline()     Box(         modifier = Modifier             .size(56.dp)@@ -119,3 +128,51 @@ private fun TvNetworkTile(     } } ++/**+ * Launcher-local validated-internet signal for the TV network tile.+ *+ * Same semantics as `:library:network`'s `ConnectivityMonitor` (validated ++ * internet capability), kept local so the launcher — which takes no+ * `:library:network` dependency — does not import it and reintroduce the+ * #884 permission leak. The required `ACCESS_NETWORK_STATE` is declared by+ * this app's own manifest.+ */+@Composable+private fun rememberLauncherOnline(): State<Boolean> {+    val context = LocalContext.current+    return produceState(initialValue = false, context) {+        val cm = context.applicationContext+            .getSystemService(Context.CONNECTIVITY_SERVICE) as? ConnectivityManager+        if (cm == null) {+            value = false+            return@produceState+        }+        fun validated(): Boolean {+            val active = cm.activeNetwork ?: return false+            val caps = cm.getNetworkCapabilities(active) ?: return false+            return caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED) &&+                caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)+        }+        value = validated()+        val callback = object : ConnectivityManager.NetworkCallback() {+            override fun onAvailable(network: Network) {+                value = validated()+            }++            override fun onCapabilitiesChanged(network: Network, caps: NetworkCapabilities) {+                value = validated()+            }++            override fun onLost(network: Network) {+                value = validated()+            }++            override fun onUnavailable() {+                value = false+            }+        }+        runCatching { cm.registerDefaultNetworkCallback(callback) }+        awaitDispose { runCatching { cm.unregisterNetworkCallback(callback) } }+    }+}
library/map/AGENTS.md
diff --git a/library/map/AGENTS.md b/library/map/AGENTS.mdindex e4f799032b..321cedef37 100644--- a/library/map/AGENTS.md+++ b/library/map/AGENTS.md@@ -6,7 +6,12 @@ - Gradle: :library:map / dir: library/map/ - Package roots present: (vector-map renderer — one package + Rust core) - Entry files: VectorMap.kt + MapScope.kt (no MainActivity/Route — library)-- Deps: :library:network+- Deps: (none — no project dependencies by design, #884)+- Network: tile range fetches reach the host app's `NetworkClient` over JNI+  (`NativeHttpBridge`, resolved at runtime from the app classpath — every map+  host already depends on `:library:network` directly); the live+  online/offline signal is injected per call site via `VectorMap(online = …)`+  for the same reason. This module declares INTERNET itself. - Metadata: metadata_data/library-map.md (absent — libraries have none by design) - Rust: yes / screenshotTest: no 
library/map/build.gradle.kts
diff --git a/library/map/build.gradle.kts b/library/map/build.gradle.ktsindex 5c6c3dcb37..4edf520179 100644--- a/library/map/build.gradle.kts+++ b/library/map/build.gradle.kts@@ -26,15 +26,17 @@ dependencies {     // plugin: one consumer does not justify reconfiguring every module.     implementation(libs.androidx.lifecycle.runtime.compose) -    // The renderer's HTTP transport, and now also ConnectivityMonitor (package-    // com.vayunmathur.library.util), which drives live online/offline into the renderer.-    // The Rust crate does not open sockets: it calls back through library/jni-http into-    // NativeHttpBridge here, so pmtiles range requests keep library:network's reduced CA-    // bundle and HttpURLConnection-only policy, and the renderer gains no second TLS stack.+    // The renderer's HTTP transport reaches the app's NetworkClient through JNI:+    // the Rust core calls back through library/jni-http into NativeHttpBridge+    // (com.vayunmathur.library.network), which the HOST app provides — all ten+    // map hosts already depend on :library:network directly. The bridge class is+    // resolved at runtime from the app's classpath, so this module needs no+    // :library:network edge (and gains no ACCESS_NETWORK_STATE from it); the+    // tile-range requests keep library:network's reduced CA bundle and+    // HttpURLConnection-only policy with no second TLS stack (#884).     //     // Deliberately not :library — that would drag Room, DataStore, Navigation 3 and     // :sdk:games onto this module's compile classpath for one object.-    implementation(project(":library:network"))      // Own GeoPoint/GeoBounds – this module has no third-party geometry dependency. 
library/map/src/main/java/com/vayunmathur/library/map/VectorMap.kt
diff --git a/library/map/src/main/java/com/vayunmathur/library/map/VectorMap.kt b/library/map/src/main/java/com/vayunmathur/library/map/VectorMap.ktindex 1cb45c3c40..1b09dba1d1 100644--- a/library/map/src/main/java/com/vayunmathur/library/map/VectorMap.kt+++ b/library/map/src/main/java/com/vayunmathur/library/map/VectorMap.kt@@ -28,6 +28,21 @@ import androidx.compose.ui.unit.DpRect import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import kotlin.math.roundToInt+import kotlinx.coroutines.flow.MutableStateFlow+import kotlinx.coroutines.flow.StateFlow++/**+ * Default [VectorMap] online signal: constant `true`.+ *+ * Preserves the historical behaviour for hosts that never set the signal (the+ * probe this replaced optimistically reported true where there was no+ * ConnectivityManager). Hosts with `:library:network` pass+ * `ConnectivityMonitor.isOnline` instead.+ */+private val OnlineAlways: StateFlow<Boolean> = MutableStateFlow(true)++/** Default online signal for [VulkanMapSurface]; see [OnlineAlways]. */+internal val MapOnlineDefault: StateFlow<Boolean> = OnlineAlways  /**  * The vector map.@@ -163,6 +178,23 @@ fun VectorMap(      * copy at ~3 Hz and never wakes the frame loop.      */     showFrameStats: Boolean = false,+    /**+     * Live online/offline signal driving the renderer's tile policy: online it+     * fetches missing ranges, offline it serves stale cached ranges+     * ([SurfaceMapRenderer.setOnline]). Defaults to a constant-true flow that+     * preserves the historical behaviour for hosts that never set it (the old+     * probe optimistically reported true where there was no+     * ConnectivityManager).+     *+     * Hosts with `:library:network` pass `ConnectivityMonitor.isOnline`+     * (seeded via `ConnectivityMonitor.isOnline(context)`); hosts without it+     * pass their own signal. Injected rather than read from+     * `ConnectivityMonitor` directly so this module keeps no+     * `:library:network` edge (and gains no `ACCESS_NETWORK_STATE`) — the+     * map module declares INTERNET itself and every host is an online app+     * (#884).+     */+    online: kotlinx.coroutines.flow.StateFlow<Boolean> = OnlineAlways,     content: @Composable MapScope.() -> Unit = {}, ) {     val density = LocalDensity.current.density@@ -229,6 +261,7 @@ fun VectorMap(             onFrame = onFrame,             fallback = fallback,             showFrameStats = showFrameStats,+            online = online,         )          if (imageOverlay != null) {
library/map/src/main/java/com/vayunmathur/library/map/VulkanMapSurface.kt
diff --git a/library/map/src/main/java/com/vayunmathur/library/map/VulkanMapSurface.kt b/library/map/src/main/java/com/vayunmathur/library/map/VulkanMapSurface.ktindex 7396d95e95..4aaa15d96d 100644--- a/library/map/src/main/java/com/vayunmathur/library/map/VulkanMapSurface.kt+++ b/library/map/src/main/java/com/vayunmathur/library/map/VulkanMapSurface.kt@@ -24,7 +24,7 @@ import androidx.compose.ui.viewinterop.AndroidView import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleEventObserver import androidx.lifecycle.compose.LocalLifecycleOwner-import com.vayunmathur.library.util.ConnectivityMonitor+import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.first import kotlinx.coroutines.isActive import kotlinx.coroutines.withTimeoutOrNull@@ -124,6 +124,13 @@ internal fun VulkanMapSurface(      * The overlay polls the native copy and never wakes the frame loop.      */     showFrameStats: Boolean = false,+    /**+     * Live online/offline signal, forwarded from [VectorMap]: online the renderer+     * fetches missing tile ranges, offline it serves stale cached ranges. Kept+     * as a parameter (rather than read from `ConnectivityMonitor`) so this+     * module keeps no `:library:network` edge (#884).+     */+    online: StateFlow<Boolean> = MapOnlineDefault, ) {     val context = LocalContext.current     val density = LocalDensity.current.density@@ -349,19 +356,18 @@ internal fun VulkanMapSurface(      // Live connectivity, replacing a single sample taken in onSurfaceTextureAvailable.     // Collected here rather than inside the renderer so every MapNative call stays on the-    // composition dispatcher, like setPalette and setLayers.-    //-    // Two deliberate behaviour changes from the probe this replaces. ConnectivityMonitor-    // requires NET_CAPABILITY_VALIDATED, which the probe did not — an improvement for a tile-    // fetcher, since a captive portal handing back HTML for a byte range is worse than-    // knowing you are offline. And it reports false where there is no ConnectivityManager,-    // where the probe optimistically returned true; that only arises under unit/Robolectric,-    // where the effect is to pin the map to cache.-    LaunchedEffect(host) {-        // Seeded synchronously so the first value is not spuriously false. This also-        // lazily starts the monitor.-        renderer.setOnline(ConnectivityMonitor.isOnline(context))-        ConnectivityMonitor.isOnline.collect { renderer.setOnline(it) }+    // composition dispatcher, like setPalette and setLayers. The signal is injected by the+    // host (see VectorMap's `online` param): hosts with :library:network pass+    // ConnectivityMonitor.isOnline (which requires NET_CAPABILITY_VALIDATED — an+    // improvement for a tile fetcher over the old probe, since a captive portal handing+    // back HTML for a byte range is worse than knowing you are offline), and hosts+    // without it keep the constant-true default (the old probe optimistically returned+    // true where there was no ConnectivityManager; under unit/Robolectric that pins the+    // map to cache).+    LaunchedEffect(host, online) {+        // Seeded synchronously so the first value is not spuriously false.+        renderer.setOnline(online.value)+        online.collect { renderer.setOnline(it) }     }      Box(modifier) {
maps/src/main/java/com/vayunmathur/maps/ui/map/MapSurface.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/map/MapSurface.kt b/maps/src/main/java/com/vayunmathur/maps/ui/map/MapSurface.ktindex d3fd650b3f..98a510d48c 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/map/MapSurface.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/map/MapSurface.kt@@ -19,6 +19,7 @@ import com.vayunmathur.library.map.TileSource import com.vayunmathur.library.map.UserPuck import com.vayunmathur.library.map.VectorMap import com.vayunmathur.library.ui.FreeHeightSheetState+import com.vayunmathur.library.util.ConnectivityMonitor import com.vayunmathur.maps.data.ParkingSpot import com.vayunmathur.maps.data.SavedPlace import com.vayunmathur.maps.data.SpecificFeature@@ -186,6 +187,9 @@ fun MapSurface(         body = body,         moonTextures = moonTextures,         options = mapOptions,+        // Live online/offline into the renderer's tile policy (injected so+        // :library:map keeps no :library:network edge, #884).+        online = ConnectivityMonitor.isOnline,         userPuck = userPuck,         regionMask = regionMaskFor(selectedFeature),         // The live traffic overlay: baked geometry gated by [LayerOptions.traffic] above,
openassistant/src/main/java/com/vayunmathur/openassistant/MainActivity.kt
diff --git a/openassistant/src/main/java/com/vayunmathur/openassistant/MainActivity.kt b/openassistant/src/main/java/com/vayunmathur/openassistant/MainActivity.ktindex 6f9a58a30f..9b44da91fb 100644--- a/openassistant/src/main/java/com/vayunmathur/openassistant/MainActivity.kt+++ b/openassistant/src/main/java/com/vayunmathur/openassistant/MainActivity.kt@@ -7,7 +7,6 @@ import androidx.lifecycle.viewmodel.initializer import androidx.lifecycle.viewmodel.viewModelFactory import com.vayunmathur.library.util.NavKey import com.vayunmathur.library.ui.MaActivity-import com.vayunmathur.library.util.OfflineAware import com.vayunmathur.library.downloadservice.InitialModelDownloadChecker import com.vayunmathur.library.downloadservice.ModelUrls import com.vayunmathur.library.util.DataStoreUtils@@ -44,10 +43,13 @@ class MainActivity : MaActivity() {     @Composable     override fun Content() {         val ds = DataStoreUtils.getInstance(this)+        // No OfflineAware banner: openassistant takes no :library:network+        // dependency, so the connectivity-monitor UI (which needs+        // ACCESS_NETWORK_STATE from :library:network) cannot live here without+        // reintroducing the #884 leak. Download gating already surfaces+        // offline state via InitialModelDownloadChecker.         InitialModelDownloadChecker(ds, ModelUrls.INITIAL) {-            OfflineAware {-                Navigation(assistantViewModel)-            }+            Navigation(assistantViewModel)         }     } 
photos/src/main/java/com/vayunmathur/photos/MainActivity.kt
diff --git a/photos/src/main/java/com/vayunmathur/photos/MainActivity.kt b/photos/src/main/java/com/vayunmathur/photos/MainActivity.ktindex 9b1fd67632..3ba7b359e6 100644--- a/photos/src/main/java/com/vayunmathur/photos/MainActivity.kt+++ b/photos/src/main/java/com/vayunmathur/photos/MainActivity.kt@@ -37,7 +37,6 @@ import com.vayunmathur.library.ui.AppPermissionsGate import com.vayunmathur.library.ui.AppPermissionsSpec import com.vayunmathur.library.ui.MaFragmentActivity import com.vayunmathur.library.ui.PermissionRequirement-import com.vayunmathur.library.util.OfflineAware import com.vayunmathur.library.util.DataStoreUtils import com.vayunmathur.library.util.MainNavigation import com.vayunmathur.library.util.MorphPage@@ -109,10 +108,12 @@ class MainActivity : MaFragmentActivity() {                 .distinctUntilChanged()                 .collect { dataStore.setLong(COLUMN_COUNT_KEY, it.toLong()) }         }-        OfflineAware {-            CompositionLocalProvider(LocalColumnCount provides columnCount) {-                PermissionsWrapper(viewUri = if (intent?.action == Intent.ACTION_VIEW) intent?.data else null)-            }+        // No OfflineAware banner: photos is offline-first and takes no+        // :library:network dependency, so the connectivity-monitor UI (which+        // needs ACCESS_NETWORK_STATE from :library:network) cannot live here+        // without reintroducing the #884 leak. Failures surface per-screen.+        CompositionLocalProvider(LocalColumnCount provides columnCount) {+            PermissionsWrapper(viewUri = if (intent?.action == Intent.ACTION_VIEW) intent?.data else null)         }     } 
photos/src/main/java/com/vayunmathur/photos/ui/MapPage.kt
diff --git a/photos/src/main/java/com/vayunmathur/photos/ui/MapPage.kt b/photos/src/main/java/com/vayunmathur/photos/ui/MapPage.ktindex 825912136f..13d8e76f77 100644--- a/photos/src/main/java/com/vayunmathur/photos/ui/MapPage.kt+++ b/photos/src/main/java/com/vayunmathur/photos/ui/MapPage.kt@@ -135,6 +135,9 @@ fun MapPage(                 onMapClick = {                     selectedCluster = null                 },+                // Photos has no :library:network dependency (offline-first+                // gallery) so it keeps the constant-online default: its map+                // content is local photos plus cached tiles (#884).             ) {                 // Chips are centre-anchored, which is a deliberate 25 dp shift: this used to                 // offset a 50 dp chip by the raw projected point, so every cluster was drawn
taxi/src/main/java/com/vayunmathur/taxi/ui/RideContent.kt
diff --git a/taxi/src/main/java/com/vayunmathur/taxi/ui/RideContent.kt b/taxi/src/main/java/com/vayunmathur/taxi/ui/RideContent.ktindex a59f52229d..62069ee9ce 100644--- a/taxi/src/main/java/com/vayunmathur/taxi/ui/RideContent.kt+++ b/taxi/src/main/java/com/vayunmathur/taxi/ui/RideContent.kt@@ -22,6 +22,7 @@ import com.vayunmathur.library.map.RouteOverlay import com.vayunmathur.library.map.VectorMap import com.vayunmathur.library.ui.IconLocationOn import com.vayunmathur.library.ui.IconMyLocation+import com.vayunmathur.library.util.ConnectivityMonitor import com.vayunmathur.taxi.R import com.vayunmathur.taxi.data.Place import com.vayunmathur.taxi.data.Provider@@ -112,7 +113,7 @@ internal fun RideNarrowContent(                 .height(220.dp)                 .clip(RoundedCornerShape(bottomStart = 24.dp, bottomEnd = 24.dp)),         ) {-            VectorMap(cameraState = data.camera, route = data.routeOverlay, modifier = Modifier.fillMaxSize(), options = MapOptions(gestureOptions = GestureOptions.TiltLocked))+            VectorMap(cameraState = data.camera, route = data.routeOverlay, modifier = Modifier.fillMaxSize(), options = MapOptions(gestureOptions = GestureOptions.TiltLocked), online = ConnectivityMonitor.isOnline)             // Overlay pins for pickup and destination, positioned from the live camera             // projection so they track pan/zoom (same pattern as fooddelivery's map).             val projection = data.camera.projection
taxi/src/main/java/com/vayunmathur/taxi/ui/RideInputs.kt
diff --git a/taxi/src/main/java/com/vayunmathur/taxi/ui/RideInputs.kt b/taxi/src/main/java/com/vayunmathur/taxi/ui/RideInputs.ktindex 72db19a776..a2c5333b7e 100644--- a/taxi/src/main/java/com/vayunmathur/taxi/ui/RideInputs.kt+++ b/taxi/src/main/java/com/vayunmathur/taxi/ui/RideInputs.kt@@ -34,6 +34,7 @@ import com.vayunmathur.library.map.GestureOptions import com.vayunmathur.library.map.MapOptions import com.vayunmathur.library.map.RouteOverlay import com.vayunmathur.library.map.VectorMap+import com.vayunmathur.library.util.ConnectivityMonitor import com.vayunmathur.library.ui.Card import com.vayunmathur.library.ui.HorizontalDivider import com.vayunmathur.library.ui.IconButton@@ -60,7 +61,7 @@ internal fun RideMapPane(     modifier: Modifier = Modifier, ) {     Box(modifier) {-        VectorMap(cameraState = camera, route = routeOverlay, modifier = Modifier.fillMaxSize(), options = MapOptions(gestureOptions = GestureOptions.TiltLocked))+        VectorMap(cameraState = camera, route = routeOverlay, modifier = Modifier.fillMaxSize(), options = MapOptions(gestureOptions = GestureOptions.TiltLocked), online = ConnectivityMonitor.isOnline)         val projection = camera.projection         if (projection != null) {             pickup?.let {
taxi/src/main/java/com/vayunmathur/taxi/ui/RideTrackingMap.kt
diff --git a/taxi/src/main/java/com/vayunmathur/taxi/ui/RideTrackingMap.kt b/taxi/src/main/java/com/vayunmathur/taxi/ui/RideTrackingMap.ktindex 9edc865b99..bc9df83d79 100644--- a/taxi/src/main/java/com/vayunmathur/taxi/ui/RideTrackingMap.kt+++ b/taxi/src/main/java/com/vayunmathur/taxi/ui/RideTrackingMap.kt@@ -17,6 +17,7 @@ import com.vayunmathur.library.map.MapOptions import com.vayunmathur.library.map.VectorMap import com.vayunmathur.library.map.rememberCameraState import com.vayunmathur.library.ui.CircularProgressIndicator+import com.vayunmathur.library.util.ConnectivityMonitor import com.vayunmathur.library.ui.IconHome import com.vayunmathur.library.ui.IconMyLocation import com.vayunmathur.library.ui.IconNavigationArrow@@ -67,7 +68,7 @@ internal fun TrackingMap(ride: ActiveRide?, driverLoc: DriverLocation?, modifier     }      Box(modifier) {-        VectorMap(cameraState = camera, options = MapOptions(gestureOptions = GestureOptions.TiltLocked)) {+        VectorMap(cameraState = camera, options = MapOptions(gestureOptions = GestureOptions.TiltLocked), online = ConnectivityMonitor.isOnline) {             pickup?.let {                 MapMarker(it) {                     PinChrome(MaterialTheme.colorScheme.tertiary) { IconMyLocation(tint = Color.White) }
travel/src/main/java/com/vayunmathur/travel/ui/ExploreMapPage.kt
diff --git a/travel/src/main/java/com/vayunmathur/travel/ui/ExploreMapPage.kt b/travel/src/main/java/com/vayunmathur/travel/ui/ExploreMapPage.ktindex fff5e41b55..b77f254db7 100644--- a/travel/src/main/java/com/vayunmathur/travel/ui/ExploreMapPage.kt+++ b/travel/src/main/java/com/vayunmathur/travel/ui/ExploreMapPage.kt@@ -17,6 +17,7 @@ import com.vayunmathur.library.map.CameraPosition import com.vayunmathur.library.map.GeoPoint import com.vayunmathur.library.map.VectorMap import com.vayunmathur.library.map.rememberCameraState+import com.vayunmathur.library.util.ConnectivityMonitor import com.vayunmathur.library.ui.AppScaffold import com.vayunmathur.library.ui.ExperimentalMaterial3Api import com.vayunmathur.library.ui.appBarScrollBehavior@@ -102,7 +103,7 @@ fun ExploreMapPage(                     emptyMessage = stringResource(R.string.explore_empty),                 )             } else {-                VectorMap(cameraState = camera) {+                VectorMap(cameraState = camera, online = ConnectivityMonitor.isOnline) {                     state.destinations.forEach { dest ->                         val lat = dest.latitude ?: return@forEach                         val lng = dest.longitude ?: return@forEach
weather/src/main/java/com/vayunmathur/weather/ui/WeatherMapPage.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/WeatherMapPage.kt b/weather/src/main/java/com/vayunmathur/weather/ui/WeatherMapPage.ktindex 511cf1ac59..072a66dc6d 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/WeatherMapPage.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/WeatherMapPage.kt@@ -47,6 +47,7 @@ import com.vayunmathur.library.map.OrnamentOptions import com.vayunmathur.library.map.MapStyle import com.vayunmathur.library.map.VectorMap import com.vayunmathur.library.map.rememberCameraState+import com.vayunmathur.library.util.ConnectivityMonitor import com.vayunmathur.library.map.GeoPoint  /**@@ -111,6 +112,7 @@ fun WeatherMapPage(             imageOverlay = state.overlay?.let { bmp ->                 state.overlayBounds?.let { bounds -> ImageOverlay(bmp, bounds, 0.7f) }             },+            online = ConnectivityMonitor.isOnline,         )          // Top bar: back + title + measure selector.