Modern Apps git

← Modern-Apps.git

apps: drop dead permissions, declare contacts read where used

Commit
2d300f953552dc6577b6f4fbe53623dbab0b800c
Author
Vayun Mathur <[email protected]>
When
2026-11-21 11:09 UTC (15 days ago)
Parents
dacc875
Photos declared WRITE_EXTERNAL_STORAGE (maxSdk 29, below the
app's minSdk) and requestLegacyExternalStorage with no code
path using them - both removed. Auto declared
SYSTEM_ALERT_WINDOW but uses Presentation on a virtual
display, never overlay windows - removed, along with the dead
appops grant in its FullE2eTest.

Maps' PickContact fallback reads whole-contact postal data
but READ_CONTACTS was never declared (the request would fail)
- declared with a comment. Two census premises did not hold
and were kept: maps' POST_PROMOTED_NOTIFICATIONS powers Live
Update promotion, and health's FOREGROUND_SERVICE_MEDIA_PLAYBACK
backs a real dose-sound playback service.

Verified: compileDevKotlin for photos, maps, auto, health and
communicate passes (communicate's WRITE_CONTACTS declaration
landed in the previous commit).

Diff

auto/src/androidTest/java/com/vayunmathur/auto/ui/FullE2eTest.kt
diff --git a/auto/src/androidTest/java/com/vayunmathur/auto/ui/FullE2eTest.kt b/auto/src/androidTest/java/com/vayunmathur/auto/ui/FullE2eTest.ktindex aa70369916..8fbc7dd3ab 100644--- a/auto/src/androidTest/java/com/vayunmathur/auto/ui/FullE2eTest.kt+++ b/auto/src/androidTest/java/com/vayunmathur/auto/ui/FullE2eTest.kt@@ -90,15 +90,6 @@ class FullE2eTest {                 // content assertions below report it.             }         }-        for (command in SPECIAL_ACCESS_COMMANDS) {-            try {-                uiAutomation.executeShellCommand(command.format(packageName)).close()-            } catch (ignored: SecurityException) {-                // Appop missing on this release: the gate assertion reports it.-            } catch (ignored: IOException) {-                // Shell pipe failed: the gate assertion below reports it.-            }-        }     }      private companion object {@@ -107,14 +98,5 @@ class FullE2eTest {         private const val CONNECTION_LABEL = "Connection"         private const val PERMISSION_GATE_TITLE = "Grant Required Permissions" -        /**-         * Special access this app declares: drawing over other apps (the-         * car-mode overlays) has no pm-grantable permission, but the shell-         * can flip its appop. Ignored where the appop does not exist; the-         * content assertion reports it.-         */-        private val SPECIAL_ACCESS_COMMANDS = arrayOf(-            "appops set %s SYSTEM_ALERT_WINDOW allow",-        )     } }
auto/src/main/AndroidManifest.xml
diff --git a/auto/src/main/AndroidManifest.xml b/auto/src/main/AndroidManifest.xmlindex af835d1e84..fb6baadbad 100644--- a/auto/src/main/AndroidManifest.xml+++ b/auto/src/main/AndroidManifest.xml@@ -135,7 +135,6 @@          app is foreground. -->     <uses-permission android:name="android.permission.START_ACTIVITIES_FROM_BACKGROUND" tools:ignore="ProtectedPermissions" />     <uses-permission android:name="android.permission.ENTER_CAR_MODE_PRIORITIZED" tools:ignore="ProtectedPermissions" />-    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />     <uses-permission android:name="android.permission.INTERACT_ACROSS_PROFILES" tools:ignore="ProtectedPermissions" />     <!-- Do-not-disturb state for the rail status cluster (DND icon): reading          the interruption filter needs the policy grant; without it the icon
maps/src/main/AndroidManifest.xml
diff --git a/maps/src/main/AndroidManifest.xml b/maps/src/main/AndroidManifest.xmlindex dbc37e9f62..ab72128b74 100644--- a/maps/src/main/AndroidManifest.xml+++ b/maps/src/main/AndroidManifest.xml@@ -19,6 +19,8 @@      <uses-permission android:name="com.vayunmathur.taxi.permissions.ACCESS_RIDES" /> +    <!-- PickContact fallback in ContactAddressButton: whole-contact postal reads need this. -->+    <uses-permission android:name="android.permission.READ_CONTACTS" />     <uses-permission android:name="android.permission.RECORD_AUDIO" />     <queries>         <intent>
photos/src/main/AndroidManifest.xml
diff --git a/photos/src/main/AndroidManifest.xml b/photos/src/main/AndroidManifest.xmlindex 5ddef92810..af353fc2d6 100644--- a/photos/src/main/AndroidManifest.xml+++ b/photos/src/main/AndroidManifest.xml@@ -10,10 +10,6 @@     <uses-permission         android:name="android.permission.READ_EXTERNAL_STORAGE"         android:maxSdkVersion="32" />-    <uses-permission-        android:name="android.permission.WRITE_EXTERNAL_STORAGE"-        android:maxSdkVersion="29" />-     <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />     <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />     <uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />@@ -33,7 +29,6 @@         android:dataExtractionRules="@xml/data_extraction_rules"         android:icon="@mipmap/ic_launcher"         android:label="@string/app_name"-        android:requestLegacyExternalStorage="true"         android:roundIcon="@mipmap/ic_launcher"         android:supportsRtl="true"         android:theme="@style/Theme.General">