networklocation: fix all lint findings
- Commit
4b4078dd5db69717b491c15d1be2f27fa97c0aa7- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-17 05:16 UTC (19 days ago)
- Parents
964153a
Fix every lint warning reported for the networklocation module's own sources by :networklocation:lintDev, now 0 errors / 0 warnings for networklocation/** (remaining report entries are transitive library findings owned by other clusters). PackageStructure (11): BeaconKeys/PositioningData to domain/, OfflineDatabases/NearbyWifi to platform/, NearbyCells to telephony/, OfflineDatabaseSection to ui/, NetworkLocationService/GeocodeService to service/ with manifest names and all test imports updated. Three files stay at the root under the verbatim // PACKAGE STRUCTURE EXCEPTION (JNI) marker — GeocoderNative, NetworkLocationNative and WpsStoreNative have FQNs frozen by Rust JNI symbol mangling, the lint rule's own documented exception hatch. MissingPermission (2): the cell/wifi scans catch SecurityException explicitly and return an empty scan. ExportedService (2): both framework services are guarded by INSTALL_LOCATION_PROVIDER. A DataExtractionRules finding surfaced on re-analysis: added an exclude-all @xml/data_extraction_rules matching allowBackup=false. Manifest: POST_NOTIFICATIONS added, optional telephony uses-feature added, and tools:ignore ProtectedPermissions on INSTALL_LOCATION_PROVIDER, LOCATION_HARDWARE, MODIFY_PHONE_STATE and UPDATE_DEVICE_STATS — this is the preinstalled /system/priv-app platform location provider those signature|privileged permissions exist for. UseKtx: String.toUri(). No lint config or baseline changed. Verified: ./gradlew :networklocation:lintDev (0 own-module errors/warnings) and :networklocation:testDevUnitTest green.
Diff
networklocation/src/main/AndroidManifest.xml
diff --git a/networklocation/src/main/AndroidManifest.xml b/networklocation/src/main/AndroidManifest.xmlindex c487e0d6dd..259c82f746 100644--- a/networklocation/src/main/AndroidManifest.xml+++ b/networklocation/src/main/AndroidManifest.xml@@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?>-<manifest xmlns:android="http://schemas.android.com/apk/res/android">+<manifest xmlns:android="http://schemas.android.com/apk/res/android"+ xmlns:tools="http://schemas.android.com/tools"> <!-- MAOS: opt out of the GrapheneOS Sensors permission (OTHER_SENSORS). --> <!-- This app uses no motion/environment sensors; MAOS withholds the -->@@ -14,13 +15,29 @@ <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />- <uses-permission android:name="android.permission.INSTALL_LOCATION_PROVIDER" />- <uses-permission android:name="android.permission.LOCATION_HARDWARE" />- <uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />- <uses-permission android:name="android.permission.UPDATE_DEVICE_STATS" />+ <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />+ <!-- ProtectedPermissions: this app ships preinstalled in /system/priv-app as the+ platform network-location provider, so the signature|privileged permission is+ granted at install; lint cannot see the system-image grant. -->+ <uses-permission android:name="android.permission.INSTALL_LOCATION_PROVIDER" tools:ignore="ProtectedPermissions" />+ <!-- ProtectedPermissions: this app ships preinstalled in /system/priv-app as the+ platform network-location provider, so the signature|privileged permission is+ granted at install; lint cannot see the system-image grant. -->+ <uses-permission android:name="android.permission.LOCATION_HARDWARE" tools:ignore="ProtectedPermissions" />+ <!-- ProtectedPermissions: this app ships preinstalled in /system/priv-app as the+ platform network-location provider, so the signature|privileged permission is+ granted at install; lint cannot see the system-image grant. -->+ <uses-permission android:name="android.permission.MODIFY_PHONE_STATE" tools:ignore="ProtectedPermissions" />+ <!-- ProtectedPermissions: this app ships preinstalled in /system/priv-app as the+ platform network-location provider, so the signature|privileged permission is+ granted at install; lint cannot see the system-image grant. -->+ <uses-permission android:name="android.permission.UPDATE_DEVICE_STATS" tools:ignore="ProtectedPermissions" />++ <uses-feature android:name="android.hardware.telephony" android:required="false" /> <application android:allowBackup="false"+ android:dataExtractionRules="@xml/data_extraction_rules" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher"@@ -30,16 +47,18 @@ <uses-library android:name="com.android.location.provider" android:required="false" /> <service- android:name=".NetworkLocationService"- android:exported="true">+ android:name=".service.NetworkLocationService"+ android:exported="true"+ android:permission="android.permission.INSTALL_LOCATION_PROVIDER"> <intent-filter> <action android:name="com.android.location.service.v3.NetworkLocationProvider" /> </intent-filter> </service> <service- android:name=".GeocodeService"- android:exported="true">+ android:name=".service.GeocodeService"+ android:exported="true"+ android:permission="android.permission.INSTALL_LOCATION_PROVIDER"> <intent-filter> <action android:name="com.android.location.service.GeocodeProvider" /> </intent-filter>
networklocation/src/main/java/com/vayunmathur/networklocation/GeocoderNative.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/GeocoderNative.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/GeocoderNative.ktindex 1fdf8bff84..8b6d0ff7aa 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/GeocoderNative.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/GeocoderNative.kt@@ -1,5 +1,7 @@ package com.vayunmathur.networklocation +// PACKAGE STRUCTURE EXCEPTION (JNI)+ /** * JNI bridge to the native offline geocoder search in the `networklocation` Rust library * (see networklocation/src/main/rust/src/geocoder.rs). The database itself is generated
networklocation/src/main/java/com/vayunmathur/networklocation/Navigation.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/Navigation.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/Navigation.ktindex 73aa5effa4..a9d32de6b9 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/Navigation.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/Navigation.kt@@ -7,6 +7,7 @@ import com.vayunmathur.library.util.MainNavigation import com.vayunmathur.library.util.rememberNavBackStack import com.vayunmathur.networklocation.ui.SetupScreen import com.vayunmathur.networklocation.ui.StatusScreen+import com.vayunmathur.networklocation.platform.OfflineDatabases @Composable fun Navigation() {
networklocation/src/main/java/com/vayunmathur/networklocation/NetworkLocationNative.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/NetworkLocationNative.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/NetworkLocationNative.ktindex 82fecf7c21..d22900205b 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/NetworkLocationNative.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/NetworkLocationNative.kt@@ -1,5 +1,7 @@ package com.vayunmathur.networklocation +// PACKAGE STRUCTURE EXCEPTION (JNI)+ /** * JNI bridge to the native `networklocation` Rust library: device-position * estimation from the beacon fixes (cell towers + WiFi APs) resolved against the
networklocation/src/main/java/com/vayunmathur/networklocation/WpsStoreNative.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/WpsStoreNative.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/WpsStoreNative.ktindex 928346d181..c272186c06 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/WpsStoreNative.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/WpsStoreNative.kt@@ -1,5 +1,7 @@ package com.vayunmathur.networklocation +// PACKAGE STRUCTURE EXCEPTION (JNI)+ /** * JNI bridge to the native offline WPSDB reader in the `networklocation` Rust library * (see networklocation/src/main/rust/src/wpsdb.rs). It answers exact key → coordinate
networklocation/src/main/java/com/vayunmathur/networklocation/domain/BeaconKeys.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/BeaconKeys.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/domain/BeaconKeys.ktsimilarity index 98%rename from networklocation/src/main/java/com/vayunmathur/networklocation/BeaconKeys.ktrename to networklocation/src/main/java/com/vayunmathur/networklocation/domain/BeaconKeys.ktindex 728ed62fba..8e4b14d2ef 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/BeaconKeys.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/domain/BeaconKeys.kt@@ -1,4 +1,4 @@-package com.vayunmathur.networklocation+package com.vayunmathur.networklocation.domain /** * Packing of beacon identities into the 128-bit keys the offline WPSDB stores are indexed by.
networklocation/src/main/java/com/vayunmathur/networklocation/domain/PositioningData.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/PositioningData.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/domain/PositioningData.ktsimilarity index 98%rename from networklocation/src/main/java/com/vayunmathur/networklocation/PositioningData.ktrename to networklocation/src/main/java/com/vayunmathur/networklocation/domain/PositioningData.ktindex 35a81c4f8b..4472c125d3 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/PositioningData.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/domain/PositioningData.kt@@ -1,4 +1,4 @@-package com.vayunmathur.networklocation+package com.vayunmathur.networklocation.domain /** * Plain domain types shared across the network-location pipeline (scan → offline
networklocation/src/main/java/com/vayunmathur/networklocation/platform/NearbyWifi.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/wifi/NearbyWifi.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/platform/NearbyWifi.ktsimilarity index 72%rename from networklocation/src/main/java/com/vayunmathur/networklocation/wifi/NearbyWifi.ktrename to networklocation/src/main/java/com/vayunmathur/networklocation/platform/NearbyWifi.ktindex 7cb9eae15d..f88f0a7254 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/wifi/NearbyWifi.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/platform/NearbyWifi.kt@@ -1,9 +1,9 @@-package com.vayunmathur.networklocation.wifi+package com.vayunmathur.networklocation.platform import android.content.Context import android.net.wifi.WifiManager-import com.vayunmathur.networklocation.BeaconId-import com.vayunmathur.networklocation.BeaconKeys+import com.vayunmathur.networklocation.domain.BeaconId+import com.vayunmathur.networklocation.domain.BeaconKeys /** * Reads nearby WiFi access points from the platform's last scan. As a privileged@@ -15,7 +15,13 @@ class NearbyWifi(context: Context) { context.applicationContext.getSystemService(Context.WIFI_SERVICE) as? WifiManager fun scan(): List<BeaconId.Wifi> {- val results = runCatching { wifiManager?.scanResults }.getOrNull() ?: return emptyList()+ // scanResults needs ACCESS_FINE_LOCATION; without it the platform throws+ // SecurityException, which here simply means "no WiFi beacons this scan".+ val results = try {+ wifiManager?.scanResults+ } catch (e: SecurityException) {+ null+ } ?: return emptyList() return results .mapNotNull { it.BSSID } .filter { it.isNotBlank() && it != NULL_BSSID && isFixedAp(it) }
networklocation/src/main/java/com/vayunmathur/networklocation/platform/OfflineDatabases.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/OfflineDatabases.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/platform/OfflineDatabases.ktsimilarity index 99%rename from networklocation/src/main/java/com/vayunmathur/networklocation/OfflineDatabases.ktrename to networklocation/src/main/java/com/vayunmathur/networklocation/platform/OfflineDatabases.ktindex 04a24487d9..1434e8677a 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/OfflineDatabases.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/platform/OfflineDatabases.kt@@ -1,4 +1,4 @@-package com.vayunmathur.networklocation+package com.vayunmathur.networklocation.platform import android.content.Context import android.os.ParcelFileDescriptor
networklocation/src/main/java/com/vayunmathur/networklocation/provider/DatabaseStatusContract.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/provider/DatabaseStatusContract.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/provider/DatabaseStatusContract.ktindex 0753a3d032..255386be83 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/provider/DatabaseStatusContract.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/provider/DatabaseStatusContract.kt@@ -1,6 +1,7 @@ package com.vayunmathur.networklocation.provider import android.net.Uri+import androidx.core.net.toUri /** * Wire format of [DatabaseStatusProvider], so the provider and its callers agree on one@@ -15,7 +16,7 @@ object DatabaseStatusContract { const val AUTHORITY = "com.vayunmathur.networklocation.status" /** Single-row table describing whether the offline databases are on disk. */- val DATABASES: Uri = Uri.parse("content://$AUTHORITY/databases")+ val DATABASES: Uri = "content://$AUTHORITY/databases".toUri() /** 1 when every offline database is present, 0 otherwise. */ const val COLUMN_ALL_PRESENT = "all_present"
networklocation/src/main/java/com/vayunmathur/networklocation/provider/DatabaseStatusProvider.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/provider/DatabaseStatusProvider.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/provider/DatabaseStatusProvider.ktindex af0281e69b..553264f06d 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/provider/DatabaseStatusProvider.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/provider/DatabaseStatusProvider.kt@@ -7,7 +7,7 @@ import android.database.MatrixCursor import android.net.Uri import android.os.Binder import android.os.Process-import com.vayunmathur.networklocation.OfflineDatabases+import com.vayunmathur.networklocation.platform.OfflineDatabases /** * Reports whether the offline databases have been downloaded, so Settings can label its
networklocation/src/main/java/com/vayunmathur/networklocation/provider/LocationReportingTask.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/provider/LocationReportingTask.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/provider/LocationReportingTask.ktindex ec9842bcbd..fe29e0c0ac 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/provider/LocationReportingTask.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/provider/LocationReportingTask.kt@@ -5,12 +5,12 @@ import android.location.Location import android.location.LocationManager import android.os.SystemClock import com.vayunmathur.library.log.Log-import com.vayunmathur.networklocation.BeaconFix-import com.vayunmathur.networklocation.BeaconId-import com.vayunmathur.networklocation.DevicePosition+import com.vayunmathur.networklocation.domain.BeaconFix+import com.vayunmathur.networklocation.domain.BeaconId+import com.vayunmathur.networklocation.domain.DevicePosition import com.vayunmathur.networklocation.NetworkLocationNative-import com.vayunmathur.networklocation.cell.NearbyCells-import com.vayunmathur.networklocation.wifi.NearbyWifi+import com.vayunmathur.networklocation.telephony.NearbyCells+import com.vayunmathur.networklocation.platform.NearbyWifi import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob
networklocation/src/main/java/com/vayunmathur/networklocation/provider/OfflineBeaconStore.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/provider/OfflineBeaconStore.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/provider/OfflineBeaconStore.ktindex 1f95f895ea..50981ceca7 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/provider/OfflineBeaconStore.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/provider/OfflineBeaconStore.kt@@ -2,10 +2,10 @@ package com.vayunmathur.networklocation.provider import android.content.Context import android.os.ParcelFileDescriptor-import com.vayunmathur.networklocation.BeaconFix-import com.vayunmathur.networklocation.BeaconId-import com.vayunmathur.networklocation.BeaconKeys-import com.vayunmathur.networklocation.OfflineDatabases+import com.vayunmathur.networklocation.domain.BeaconFix+import com.vayunmathur.networklocation.domain.BeaconId+import com.vayunmathur.networklocation.domain.BeaconKeys+import com.vayunmathur.networklocation.platform.OfflineDatabases import com.vayunmathur.networklocation.WpsStoreNative /**
networklocation/src/main/java/com/vayunmathur/networklocation/service/GeocodeService.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/GeocodeService.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/service/GeocodeService.ktsimilarity index 97%rename from networklocation/src/main/java/com/vayunmathur/networklocation/GeocodeService.ktrename to networklocation/src/main/java/com/vayunmathur/networklocation/service/GeocodeService.ktindex 0bb2deb4bf..fb6894e044 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/GeocodeService.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/service/GeocodeService.kt@@ -1,4 +1,4 @@-package com.vayunmathur.networklocation+package com.vayunmathur.networklocation.service import android.app.Service import android.content.Intent@@ -8,6 +8,8 @@ import android.os.IBinder import android.os.ParcelFileDescriptor import com.android.location.provider.GeocodeProvider import java.util.Locale+import com.vayunmathur.networklocation.GeocoderNative+import com.vayunmathur.networklocation.platform.OfflineDatabases /** * System geocoder backed entirely by the offline planet DB — no network. Bound by the
networklocation/src/main/java/com/vayunmathur/networklocation/service/NetworkLocationService.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/NetworkLocationService.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/service/NetworkLocationService.ktsimilarity index 94%rename from networklocation/src/main/java/com/vayunmathur/networklocation/NetworkLocationService.ktrename to networklocation/src/main/java/com/vayunmathur/networklocation/service/NetworkLocationService.ktindex fa2c3f6f06..47f8726eaa 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/NetworkLocationService.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/service/NetworkLocationService.kt@@ -1,4 +1,4 @@-package com.vayunmathur.networklocation+package com.vayunmathur.networklocation.service import android.app.Service import android.content.Intent
networklocation/src/main/java/com/vayunmathur/networklocation/telephony/NearbyCells.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/cell/NearbyCells.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/telephony/NearbyCells.ktsimilarity index 84%rename from networklocation/src/main/java/com/vayunmathur/networklocation/cell/NearbyCells.ktrename to networklocation/src/main/java/com/vayunmathur/networklocation/telephony/NearbyCells.ktindex 43bf430850..c392857133 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/cell/NearbyCells.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/telephony/NearbyCells.kt@@ -1,4 +1,4 @@-package com.vayunmathur.networklocation.cell+package com.vayunmathur.networklocation.telephony import android.telephony.CellIdentityGsm import android.telephony.CellIdentityLte@@ -11,8 +11,8 @@ import android.telephony.CellInfoNr import android.telephony.CellInfoWcdma import android.telephony.TelephonyManager import android.content.Context-import com.vayunmathur.networklocation.BeaconId-import com.vayunmathur.networklocation.RadioType+import com.vayunmathur.networklocation.domain.BeaconId+import com.vayunmathur.networklocation.domain.RadioType /** * Reads nearby cell towers from [TelephonyManager]. Only towers with a full,@@ -23,7 +23,13 @@ class NearbyCells(context: Context) { context.applicationContext.getSystemService(Context.TELEPHONY_SERVICE) as? TelephonyManager fun scan(): List<BeaconId.Cell> {- val infos = runCatching { telephonyManager?.allCellInfo }.getOrNull() ?: return emptyList()+ // allCellInfo needs ACCESS_FINE_LOCATION; without it the platform throws+ // SecurityException, which here simply means "no cell beacons this scan".+ val infos = try {+ telephonyManager?.allCellInfo+ } catch (e: SecurityException) {+ null+ } ?: return emptyList() return infos.mapNotNull { it.toCell() }.distinct() }
networklocation/src/main/java/com/vayunmathur/networklocation/ui/OfflineDatabaseSection.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/OfflineDatabaseSection.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/ui/OfflineDatabaseSection.ktsimilarity index 98%rename from networklocation/src/main/java/com/vayunmathur/networklocation/OfflineDatabaseSection.ktrename to networklocation/src/main/java/com/vayunmathur/networklocation/ui/OfflineDatabaseSection.ktindex 0f7a44753e..9912a541db 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/OfflineDatabaseSection.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/ui/OfflineDatabaseSection.kt@@ -1,4 +1,4 @@-package com.vayunmathur.networklocation+package com.vayunmathur.networklocation.ui import android.content.Context import androidx.compose.foundation.layout.Column@@ -21,6 +21,7 @@ import com.vayunmathur.library.ui.Button import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.Text import com.vayunmathur.library.util.DataStoreUtils+import com.vayunmathur.networklocation.platform.OfflineDatabases /** * Offline-database section of the provider's status screen: what is on disk, and a control to
networklocation/src/main/java/com/vayunmathur/networklocation/ui/SetupScreen.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/ui/SetupScreen.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/ui/SetupScreen.ktindex 806ddd08e2..eb5d5120ec 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/ui/SetupScreen.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/ui/SetupScreen.kt@@ -13,7 +13,7 @@ import com.vayunmathur.library.ui.DesktopMaxWidthContainer import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.Text import com.vayunmathur.library.ui.appBarScrollBehavior-import com.vayunmathur.networklocation.OfflineDatabaseSection+import com.vayunmathur.networklocation.ui.OfflineDatabaseSection /** First-run screen: what the app does, and the offline-database download it cannot work without. */ @Composable
networklocation/src/main/java/com/vayunmathur/networklocation/ui/StatusScreen.kt
diff --git a/networklocation/src/main/java/com/vayunmathur/networklocation/ui/StatusScreen.kt b/networklocation/src/main/java/com/vayunmathur/networklocation/ui/StatusScreen.ktindex 72086b4062..3117a8535e 100644--- a/networklocation/src/main/java/com/vayunmathur/networklocation/ui/StatusScreen.kt+++ b/networklocation/src/main/java/com/vayunmathur/networklocation/ui/StatusScreen.kt@@ -11,7 +11,7 @@ import androidx.compose.ui.unit.dp import com.vayunmathur.library.ui.AppScaffold import com.vayunmathur.library.ui.DesktopMaxWidthContainer import com.vayunmathur.library.ui.appBarScrollBehavior-import com.vayunmathur.networklocation.OfflineDatabaseSection+import com.vayunmathur.networklocation.ui.OfflineDatabaseSection /** Home once the databases are installed: the live GPS / network-location / geocoder check. */ @Composable
networklocation/src/main/res/xml/data_extraction_rules.xml
diff --git a/networklocation/src/main/res/xml/data_extraction_rules.xml b/networklocation/src/main/res/xml/data_extraction_rules.xmlnew file mode 100644index 0000000000..2516c1e956--- /dev/null+++ b/networklocation/src/main/res/xml/data_extraction_rules.xml@@ -0,0 +1,24 @@+<?xml version="1.0" encoding="utf-8"?>+<!--+ Network Location is a preinstalled system provider with allowBackup=false: its only+ on-disk state is the multi-gigabyte offline beacon/geocoder databases, which are+ downloaded caches of published artifacts (see OfflineDatabases) plus DataStore+ preferences. Nothing here is user data, so cloud backup and device transfer are+ denied outright, matching the historic allowBackup=false behaviour on Android 12+.+-->+<data-extraction-rules>+ <cloud-backup>+ <exclude domain="root" path="." />+ <exclude domain="file" path="." />+ <exclude domain="database" path="." />+ <exclude domain="sharedpref" path="." />+ <exclude domain="external" path="." />+ </cloud-backup>+ <device-transfer>+ <exclude domain="root" path="." />+ <exclude domain="file" path="." />+ <exclude domain="database" path="." />+ <exclude domain="sharedpref" path="." />+ <exclude domain="external" path="." />+ </device-transfer>+</data-extraction-rules>
networklocation/src/test/java/com/vayunmathur/networklocation/BeaconKeysTest.kt
diff --git a/networklocation/src/test/java/com/vayunmathur/networklocation/BeaconKeysTest.kt b/networklocation/src/test/java/com/vayunmathur/networklocation/BeaconKeysTest.ktindex f9aae596ff..67d5690d1c 100644--- a/networklocation/src/test/java/com/vayunmathur/networklocation/BeaconKeysTest.kt+++ b/networklocation/src/test/java/com/vayunmathur/networklocation/BeaconKeysTest.kt@@ -6,6 +6,9 @@ import kotlin.test.assertFalse import kotlin.test.assertNotEquals import kotlin.test.assertNull import kotlin.test.assertTrue+import com.vayunmathur.networklocation.domain.BeaconKeys+import com.vayunmathur.networklocation.domain.BeaconId+import com.vayunmathur.networklocation.domain.RadioType /** * Pins the key packing against the store builder.
networklocation/src/test/java/com/vayunmathur/networklocation/GeocodeServiceTest.kt
diff --git a/networklocation/src/test/java/com/vayunmathur/networklocation/GeocodeServiceTest.kt b/networklocation/src/test/java/com/vayunmathur/networklocation/GeocodeServiceTest.ktindex a4c4abce4a..eecebce8ba 100644--- a/networklocation/src/test/java/com/vayunmathur/networklocation/GeocodeServiceTest.kt+++ b/networklocation/src/test/java/com/vayunmathur/networklocation/GeocodeServiceTest.kt@@ -13,6 +13,8 @@ import kotlin.test.assertTrue import org.junit.runner.RunWith import org.robolectric.Robolectric import org.robolectric.RobolectricTestRunner+import com.vayunmathur.networklocation.platform.OfflineDatabases+import com.vayunmathur.networklocation.service.GeocodeService @RunWith(RobolectricTestRunner::class) class GeocodeServiceTest {
networklocation/src/test/java/com/vayunmathur/networklocation/OfflineDatabasesTest.kt
diff --git a/networklocation/src/test/java/com/vayunmathur/networklocation/OfflineDatabasesTest.kt b/networklocation/src/test/java/com/vayunmathur/networklocation/OfflineDatabasesTest.ktindex d6ecea499f..f00baca3dc 100644--- a/networklocation/src/test/java/com/vayunmathur/networklocation/OfflineDatabasesTest.kt+++ b/networklocation/src/test/java/com/vayunmathur/networklocation/OfflineDatabasesTest.kt@@ -11,6 +11,7 @@ import kotlin.test.assertNull import kotlin.test.assertTrue import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner+import com.vayunmathur.networklocation.platform.OfflineDatabases @RunWith(RobolectricTestRunner::class) class OfflineDatabasesTest {
networklocation/src/test/java/com/vayunmathur/networklocation/PositioningDataTest.kt
diff --git a/networklocation/src/test/java/com/vayunmathur/networklocation/PositioningDataTest.kt b/networklocation/src/test/java/com/vayunmathur/networklocation/PositioningDataTest.ktindex 00213fff1b..fde3343a4c 100644--- a/networklocation/src/test/java/com/vayunmathur/networklocation/PositioningDataTest.kt+++ b/networklocation/src/test/java/com/vayunmathur/networklocation/PositioningDataTest.kt@@ -5,6 +5,10 @@ import kotlin.test.assertEquals import kotlin.test.assertNotEquals import kotlin.test.assertNull import kotlin.test.assertTrue+import com.vayunmathur.networklocation.domain.BeaconId+import com.vayunmathur.networklocation.domain.RadioType+import com.vayunmathur.networklocation.domain.BeaconFix+import com.vayunmathur.networklocation.domain.DevicePosition class PositioningDataTest {
networklocation/src/test/java/com/vayunmathur/networklocation/ServicesAndNavigationTest.kt
diff --git a/networklocation/src/test/java/com/vayunmathur/networklocation/ServicesAndNavigationTest.kt b/networklocation/src/test/java/com/vayunmathur/networklocation/ServicesAndNavigationTest.ktindex dee45609a8..29ce96a77c 100644--- a/networklocation/src/test/java/com/vayunmathur/networklocation/ServicesAndNavigationTest.kt+++ b/networklocation/src/test/java/com/vayunmathur/networklocation/ServicesAndNavigationTest.kt@@ -11,6 +11,8 @@ import kotlin.test.assertNull import org.junit.Rule import org.junit.runner.RunWith import org.robolectric.Robolectric+import com.vayunmathur.networklocation.platform.OfflineDatabases+import com.vayunmathur.networklocation.service.NetworkLocationService @RunWith(AndroidJUnit4::class) class ServicesAndNavigationTest {
networklocation/src/test/java/com/vayunmathur/networklocation/cell/NearbyCellsTest.kt
diff --git a/networklocation/src/test/java/com/vayunmathur/networklocation/cell/NearbyCellsTest.kt b/networklocation/src/test/java/com/vayunmathur/networklocation/cell/NearbyCellsTest.ktindex bc0d01c506..020807a189 100644--- a/networklocation/src/test/java/com/vayunmathur/networklocation/cell/NearbyCellsTest.kt+++ b/networklocation/src/test/java/com/vayunmathur/networklocation/cell/NearbyCellsTest.kt@@ -3,8 +3,8 @@ package com.vayunmathur.networklocation.cell import android.content.Context import android.telephony.TelephonyManager import androidx.test.core.app.ApplicationProvider-import com.vayunmathur.networklocation.BeaconId-import com.vayunmathur.networklocation.RadioType+import com.vayunmathur.networklocation.domain.BeaconId+import com.vayunmathur.networklocation.domain.RadioType import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue@@ -19,6 +19,7 @@ import org.robolectric.shadows.CellInfoGsmBuilder import org.robolectric.shadows.CellInfoLteBuilder import org.robolectric.shadows.CellInfoNrBuilder import org.robolectric.shadows.CellInfoWcdmaBuilder+import com.vayunmathur.networklocation.telephony.NearbyCells @RunWith(RobolectricTestRunner::class) class NearbyCellsTest {
networklocation/src/test/java/com/vayunmathur/networklocation/provider/DatabaseStatusProviderTest.kt
diff --git a/networklocation/src/test/java/com/vayunmathur/networklocation/provider/DatabaseStatusProviderTest.kt b/networklocation/src/test/java/com/vayunmathur/networklocation/provider/DatabaseStatusProviderTest.ktindex 2d74159c5b..aec6b6ff37 100644--- a/networklocation/src/test/java/com/vayunmathur/networklocation/provider/DatabaseStatusProviderTest.kt+++ b/networklocation/src/test/java/com/vayunmathur/networklocation/provider/DatabaseStatusProviderTest.kt@@ -4,7 +4,7 @@ import android.content.Context import android.net.Uri import android.os.Process import androidx.test.core.app.ApplicationProvider-import com.vayunmathur.networklocation.OfflineDatabases+import com.vayunmathur.networklocation.platform.OfflineDatabases import com.vayunmathur.networklocation.writeGeocoderDb import kotlin.test.Test import kotlin.test.assertEquals
networklocation/src/test/java/com/vayunmathur/networklocation/provider/LocationReportingTaskTest.kt
diff --git a/networklocation/src/test/java/com/vayunmathur/networklocation/provider/LocationReportingTaskTest.kt b/networklocation/src/test/java/com/vayunmathur/networklocation/provider/LocationReportingTaskTest.ktindex 8ff0b423fa..3e057e8a0f 100644--- a/networklocation/src/test/java/com/vayunmathur/networklocation/provider/LocationReportingTaskTest.kt+++ b/networklocation/src/test/java/com/vayunmathur/networklocation/provider/LocationReportingTaskTest.kt@@ -7,8 +7,8 @@ import android.net.wifi.ScanResult import android.net.wifi.WifiManager import android.telephony.TelephonyManager import androidx.test.core.app.ApplicationProvider-import com.vayunmathur.networklocation.BeaconKeys-import com.vayunmathur.networklocation.OfflineDatabases+import com.vayunmathur.networklocation.domain.BeaconKeys+import com.vayunmathur.networklocation.platform.OfflineDatabases import com.vayunmathur.networklocation.WpsRec import com.vayunmathur.networklocation.writeWpsStore import java.util.concurrent.CountDownLatch
networklocation/src/test/java/com/vayunmathur/networklocation/provider/OfflineBeaconStoreTest.kt
diff --git a/networklocation/src/test/java/com/vayunmathur/networklocation/provider/OfflineBeaconStoreTest.kt b/networklocation/src/test/java/com/vayunmathur/networklocation/provider/OfflineBeaconStoreTest.ktindex bcb6a5307d..6b6456707b 100644--- a/networklocation/src/test/java/com/vayunmathur/networklocation/provider/OfflineBeaconStoreTest.kt+++ b/networklocation/src/test/java/com/vayunmathur/networklocation/provider/OfflineBeaconStoreTest.kt@@ -2,10 +2,10 @@ package com.vayunmathur.networklocation.provider import android.content.Context import androidx.test.core.app.ApplicationProvider-import com.vayunmathur.networklocation.BeaconId-import com.vayunmathur.networklocation.BeaconKeys-import com.vayunmathur.networklocation.OfflineDatabases-import com.vayunmathur.networklocation.RadioType+import com.vayunmathur.networklocation.domain.BeaconId+import com.vayunmathur.networklocation.domain.BeaconKeys+import com.vayunmathur.networklocation.platform.OfflineDatabases+import com.vayunmathur.networklocation.domain.RadioType import com.vayunmathur.networklocation.WpsRec import com.vayunmathur.networklocation.writeWpsStore import kotlin.test.Test
networklocation/src/test/java/com/vayunmathur/networklocation/ui/ScreensComposeTest.kt
diff --git a/networklocation/src/test/java/com/vayunmathur/networklocation/ui/ScreensComposeTest.kt b/networklocation/src/test/java/com/vayunmathur/networklocation/ui/ScreensComposeTest.ktindex bfce5d8863..a92e7886aa 100644--- a/networklocation/src/test/java/com/vayunmathur/networklocation/ui/ScreensComposeTest.kt+++ b/networklocation/src/test/java/com/vayunmathur/networklocation/ui/ScreensComposeTest.kt@@ -13,7 +13,7 @@ import androidx.compose.ui.test.performClick import androidx.compose.ui.test.performScrollTo import androidx.test.core.app.ApplicationProvider import androidx.test.ext.junit.runners.AndroidJUnit4-import com.vayunmathur.networklocation.OfflineDatabases+import com.vayunmathur.networklocation.platform.OfflineDatabases import com.vayunmathur.networklocation.writeGeocoderDb import kotlin.test.Test import kotlin.test.assertTrue
networklocation/src/test/java/com/vayunmathur/networklocation/wifi/NearbyWifiTest.kt
diff --git a/networklocation/src/test/java/com/vayunmathur/networklocation/wifi/NearbyWifiTest.kt b/networklocation/src/test/java/com/vayunmathur/networklocation/wifi/NearbyWifiTest.ktindex fc16cf7cfb..9a1bc4755b 100644--- a/networklocation/src/test/java/com/vayunmathur/networklocation/wifi/NearbyWifiTest.kt+++ b/networklocation/src/test/java/com/vayunmathur/networklocation/wifi/NearbyWifiTest.kt@@ -4,13 +4,14 @@ import android.content.Context import android.net.wifi.ScanResult import android.net.wifi.WifiManager import androidx.test.core.app.ApplicationProvider-import com.vayunmathur.networklocation.BeaconId+import com.vayunmathur.networklocation.domain.BeaconId import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner import org.robolectric.Shadows.shadowOf+import com.vayunmathur.networklocation.platform.NearbyWifi @RunWith(RobolectricTestRunner::class) class NearbyWifiTest {