MAOS.git
Publicgit clone https://git.maproj.org/MAOS.gitMAOS.git / Android.bp
Android.bp518 lines · 20.6 KiBRaw
| 1 | soong_namespace { |
| 2 | } |
| 3 | |
| 4 | // Modern Apps prebuilt userspace apps for MAOS (Modern Apps OS). |
| 5 | // |
| 6 | // Each app ships as an android_app_import so its existing com.vayunmathur signing |
| 7 | // certificate (the README SHA-256 cert) is preserved via `presigned: true`. Do NOT |
| 8 | // port these Gradle/Compose apps to Soong. |
| 9 | // |
| 10 | // APKs live in prebuilts/ and are populated by scripts/collect-apks.sh before a build. |
| 11 | |
| 12 | android_app_import { |
| 13 | name: "ModernAppsWeb", |
| 14 | apk: "prebuilts/web-release.apk", |
| 15 | presigned: true, |
| 16 | preprocessed: true, |
| 17 | product_specific: true, |
| 18 | dex_preopt: { |
| 19 | enabled: false, |
| 20 | }, |
| 21 | } |
| 22 | |
| 23 | android_app_import { |
| 24 | name: "ModernAppsCamera", |
| 25 | apk: "prebuilts/camera-release.apk", |
| 26 | presigned: true, |
| 27 | preprocessed: true, |
| 28 | product_specific: true, |
| 29 | dex_preopt: { |
| 30 | enabled: false, |
| 31 | }, |
| 32 | } |
| 33 | |
| 34 | android_app_import { |
| 35 | name: "ModernAppsPdf", |
| 36 | apk: "prebuilts/pdf-release.apk", |
| 37 | presigned: true, |
| 38 | preprocessed: true, |
| 39 | product_specific: true, |
| 40 | dex_preopt: { |
| 41 | enabled: false, |
| 42 | }, |
| 43 | } |
| 44 | |
| 45 | android_app_import { |
| 46 | name: "ModernAppsContacts", |
| 47 | apk: "prebuilts/contacts-release.apk", |
| 48 | presigned: true, |
| 49 | preprocessed: true, |
| 50 | product_specific: true, |
| 51 | dex_preopt: { |
| 52 | enabled: false, |
| 53 | }, |
| 54 | } |
| 55 | |
| 56 | android_app_import { |
| 57 | name: "ModernAppsCalculator", |
| 58 | apk: "prebuilts/calculator-release.apk", |
| 59 | presigned: true, |
| 60 | preprocessed: true, |
| 61 | product_specific: true, |
| 62 | dex_preopt: { |
| 63 | enabled: false, |
| 64 | }, |
| 65 | } |
| 66 | |
| 67 | android_app_import { |
| 68 | name: "ModernAppsClock", |
| 69 | apk: "prebuilts/clock-release.apk", |
| 70 | presigned: true, |
| 71 | preprocessed: true, |
| 72 | product_specific: true, |
| 73 | dex_preopt: { |
| 74 | enabled: false, |
| 75 | }, |
| 76 | } |
| 77 | |
| 78 | // Files is PRIVILEGED: in the system build it absorbs DocumentsUI's Storage Access |
| 79 | // Framework role and therefore needs the signature|privileged MANAGE_DOCUMENTS |
| 80 | // permission, allowlisted in privapp-permissions-modern-apps.xml. It installs to |
| 81 | // /product/priv-app. The SAF picker UI itself is implemented in the Files app's |
| 82 | // system build variant (Modern-Apps repo), not here. |
| 83 | android_app_import { |
| 84 | name: "ModernAppsFiles", |
| 85 | apk: "prebuilts/files-release.apk", |
| 86 | presigned: true, |
| 87 | preprocessed: true, |
| 88 | privileged: true, |
| 89 | product_specific: true, |
| 90 | dex_preopt: { |
| 91 | enabled: false, |
| 92 | }, |
| 93 | } |
| 94 | |
| 95 | android_app_import { |
| 96 | name: "ModernAppsPhotos", |
| 97 | apk: "prebuilts/photos-release.apk", |
| 98 | presigned: true, |
| 99 | preprocessed: true, |
| 100 | product_specific: true, |
| 101 | dex_preopt: { |
| 102 | enabled: false, |
| 103 | }, |
| 104 | } |
| 105 | |
| 106 | android_app_import { |
| 107 | name: "ModernAppsStore", |
| 108 | apk: "prebuilts/appstore-release.apk", |
| 109 | presigned: true, |
| 110 | preprocessed: true, |
| 111 | privileged: true, |
| 112 | product_specific: true, |
| 113 | dex_preopt: { |
| 114 | enabled: false, |
| 115 | }, |
| 116 | } |
| 117 | |
| 118 | // Keyboard replaces AOSP LatinIME as the system IME. Direct Boot support (for lock-screen |
| 119 | // input after a reboot) is declared in the keyboard app's own manifest, not here. |
| 120 | android_app_import { |
| 121 | name: "ModernAppsKeyboard", |
| 122 | apk: "prebuilts/keyboard-release.apk", |
| 123 | presigned: true, |
| 124 | preprocessed: true, |
| 125 | product_specific: true, |
| 126 | dex_preopt: { |
| 127 | enabled: false, |
| 128 | }, |
| 129 | } |
| 130 | |
| 131 | // Speech is the default on-device STT (RecognitionService) and TTS (TextToSpeech) engine. |
| 132 | // Replaces GrapheneOS's SpeechServices (removed in modern_apps.mk). Wired up via |
| 133 | // config_default*SpeechRecognitionService and, for TTS, by being the only installed engine. |
| 134 | android_app_import { |
| 135 | name: "ModernAppsSpeech", |
| 136 | apk: "prebuilts/speech-release.apk", |
| 137 | presigned: true, |
| 138 | preprocessed: true, |
| 139 | product_specific: true, |
| 140 | dex_preopt: { |
| 141 | enabled: false, |
| 142 | }, |
| 143 | } |
| 144 | |
| 145 | // NetworkLocation is PRIVILEGED: it provides both the network location provider and the |
| 146 | // offline geocoder, replacing GrapheneOS's NetworkLocation (removed in modern_apps.mk). It |
| 147 | // needs the signature|privileged INSTALL_LOCATION_PROVIDER / LOCATION_HARDWARE / |
| 148 | // MODIFY_PHONE_STATE / UPDATE_DEVICE_STATS perms (allowlisted in |
| 149 | // privapp-permissions-modern-apps.xml) and is pinned via config_networkLocationProviderPackageName |
| 150 | // and config_geocoderProviderPackageName in the frameworks/base overlay. |
| 151 | android_app_import { |
| 152 | name: "ModernAppsNetworkLocation", |
| 153 | apk: "prebuilts/networklocation-release.apk", |
| 154 | presigned: true, |
| 155 | preprocessed: true, |
| 156 | privileged: true, |
| 157 | product_specific: true, |
| 158 | dex_preopt: { |
| 159 | enabled: false, |
| 160 | }, |
| 161 | } |
| 162 | |
| 163 | // Calendar replaces the stock AOSP Calendar (com.android.calendar, module Calendar). Uses the |
| 164 | // system CalendarProvider via CalendarContract — no backend of its own. |
| 165 | android_app_import { |
| 166 | name: "ModernAppsCalendar", |
| 167 | apk: "prebuilts/calendar-release.apk", |
| 168 | presigned: true, |
| 169 | preprocessed: true, |
| 170 | product_specific: true, |
| 171 | dex_preopt: { |
| 172 | enabled: false, |
| 173 | }, |
| 174 | } |
| 175 | |
| 176 | // Music replaces AOSP Music (com.android.music, module Music). Includes a popup single-file |
| 177 | // player (.AudioPreview equivalent) for audio VIEW intents. |
| 178 | android_app_import { |
| 179 | name: "ModernAppsMusic", |
| 180 | apk: "prebuilts/music-release.apk", |
| 181 | presigned: true, |
| 182 | preprocessed: true, |
| 183 | product_specific: true, |
| 184 | dex_preopt: { |
| 185 | enabled: false, |
| 186 | }, |
| 187 | } |
| 188 | |
| 189 | // Communicate is a unified dialer + messaging app. It replaces BOTH GrapheneOS's Dialer |
| 190 | // (com.android.dialer, module Dialer) and Messaging (com.android.messaging, module Messaging), |
| 191 | // which are removed in modern_apps.mk. It becomes the default dialer and default SMS app via |
| 192 | // config_defaultDialer / config_defaultSms in the frameworks/base overlay (RRO). It holds the |
| 193 | // DIALER and SMS roles (declares an InCallService and the SMS_DELIVER/WAP_PUSH_DELIVER |
| 194 | // receivers); the role system auto-grants its runtime permissions, so it is NOT privileged and |
| 195 | // needs no default-permissions grant. The telephony backends (TelephonyProvider, telecom |
| 196 | // framework) are untouched — only the UI apps are removed. |
| 197 | android_app_import { |
| 198 | name: "ModernAppsCommunicate", |
| 199 | apk: "prebuilts/communicate-release.apk", |
| 200 | presigned: true, |
| 201 | preprocessed: true, |
| 202 | product_specific: true, |
| 203 | dex_preopt: { |
| 204 | enabled: false, |
| 205 | }, |
| 206 | } |
| 207 | |
| 208 | // FindFamily and Share are ordinary user apps, not system components: they replace nothing |
| 209 | // GrapheneOS ships and hold no signature|privileged permission, so neither is `privileged: |
| 210 | // true` and neither needs a privapp-permissions entry. They are preinstalled only so a fresh |
| 211 | // device has them available; everything they use (location, contacts, nearby-device Bluetooth) |
| 212 | // is a runtime permission the user grants, exactly as it would be from a store install. |
| 213 | android_app_import { |
| 214 | name: "ModernAppsFindFamily", |
| 215 | apk: "prebuilts/findfamily-release.apk", |
| 216 | presigned: true, |
| 217 | preprocessed: true, |
| 218 | product_specific: true, |
| 219 | dex_preopt: { |
| 220 | enabled: false, |
| 221 | }, |
| 222 | } |
| 223 | |
| 224 | // Share is PRIVILEGED for AirDrop over Google's Mosey (AWDL) HAL: publishing the `mosey0` |
| 225 | // interface as a network needs CREATE_APP_SPECIFIC_NETWORK, and binding sockets/mDNS to that |
| 226 | // restricted network needs CONNECTIVITY_USE_RESTRICTED_NETWORKS. Both are signature|privileged |
| 227 | // and allowlisted in privapp-permissions-modern-apps.xml. Without a Mosey HAL on the device the |
| 228 | // app falls back to AirDrop over the Wi-Fi LAN and these permissions go unused. |
| 229 | android_app_import { |
| 230 | name: "ModernAppsShare", |
| 231 | apk: "prebuilts/share-release.apk", |
| 232 | presigned: true, |
| 233 | preprocessed: true, |
| 234 | privileged: true, |
| 235 | product_specific: true, |
| 236 | dex_preopt: { |
| 237 | enabled: false, |
| 238 | }, |
| 239 | } |
| 240 | |
| 241 | // Cast is PRIVILEGED: it is a remote display provider, and |
| 242 | // RemoteDisplayProviderWatcher.verifyServiceTrusted only trusts a provider whose app holds |
| 243 | // android.permission.REMOTE_DISPLAY_PROVIDER (signature|privileged). Without that the |
| 244 | // watcher logs and skips the service and Settings' Cast page stays empty. It also needs |
| 245 | // START_ACTIVITIES_FROM_BACKGROUND to reach the screen-capture consent activity from the |
| 246 | // bound service. Both are allowlisted in privapp-permissions-modern-apps.xml. |
| 247 | // |
| 248 | // The TV receiver (com.vayunmathur.cast.tv) is deliberately NOT preinstalled: it targets a |
| 249 | // television, not a phone. |
| 250 | android_app_import { |
| 251 | name: "ModernAppsCast", |
| 252 | apk: "prebuilts/cast-release.apk", |
| 253 | presigned: true, |
| 254 | preprocessed: true, |
| 255 | privileged: true, |
| 256 | product_specific: true, |
| 257 | dex_preopt: { |
| 258 | enabled: false, |
| 259 | }, |
| 260 | } |
| 261 | |
| 262 | // LogViewer is PRIVILEGED: it replaces GrapheneOS's app.grapheneos.logviewer (module |
| 263 | // LogViewer, removed from handheld_system.mk) and holds the same permissions it did. |
| 264 | // READ_LOGS, READ_LOGS_FULL, READ_OEM_UNLOCK_STATE and QUERY_USERS are allowlisted in |
| 265 | // privapp-permissions-modern-apps.xml; a missing entry there is a boot failure, not a |
| 266 | // degraded feature. Without READ_LOGS in particular logd filters logcat down to our own |
| 267 | // uid and the log simply looks EMPTY - exit code 0, no error. |
| 268 | // |
| 269 | // It declares two permissions of its own, com.vayunmathur.logviewer.SHOW_LOGCAT |
| 270 | // (signature|privileged) and .SHOW_ERROR_REPORT (signature|preinstalled), which is how |
| 271 | // Settings and the system crash dialog are allowed to open it. There is deliberately no |
| 272 | // launcher entry: both activities are permission-guarded and reached by intent. |
| 273 | // |
| 274 | // frameworks/base/core/java/android/ext/LogViewerApp.java is patched to this package name; |
| 275 | // it is the producer of every error-report intent and addresses them with setPackage(). |
| 276 | android_app_import { |
| 277 | name: "ModernAppsLogViewer", |
| 278 | apk: "prebuilts/logviewer-release.apk", |
| 279 | presigned: true, |
| 280 | preprocessed: true, |
| 281 | privileged: true, |
| 282 | product_specific: true, |
| 283 | dex_preopt: { |
| 284 | enabled: false, |
| 285 | }, |
| 286 | } |
| 287 | |
| 288 | // Euicc is PRIVILEGED: it is the system eSIM LPA (Local Profile Assistant). It declares the |
| 289 | // android.service.euicc.EuiccService and the eSIM management LUI, and drives the eUICC over a |
| 290 | // telephony logical channel, so it needs the signature|privileged WRITE_EMBEDDED_SUBSCRIPTIONS / |
| 291 | // MODIFY_PHONE_STATE / READ_PRIVILEGED_PHONE_STATE perms (allowlisted in |
| 292 | // privapp-permissions-modern-apps.xml). It replaces Google's LPA app EuiccGoogle |
| 293 | // (com.google.android.euicc, removed in modern_apps.mk). The proprietary Pixel hardware backend |
| 294 | // EuiccSupportPixel (com.google.euiccpixel) and the modem firmware are KEPT — they provide the |
| 295 | // low-level access to the built-in eUICC that this app sits on top of. |
| 296 | android_app_import { |
| 297 | name: "ModernAppsEuicc", |
| 298 | apk: "prebuilts/euicc-release.apk", |
| 299 | presigned: true, |
| 300 | preprocessed: true, |
| 301 | privileged: true, |
| 302 | product_specific: true, |
| 303 | dex_preopt: { |
| 304 | enabled: false, |
| 305 | }, |
| 306 | } |
| 307 | |
| 308 | // Backup is PRIVILEGED: it is the system app-data backup transport (declares |
| 309 | // android.app.backup.BackupTransport via a TRANSPORT_HOST service) and also does |
| 310 | // standalone encrypted file/media backup. Being the transport requires the |
| 311 | // signature|privileged BACKUP permission, and setting itself active requires |
| 312 | // WRITE_SECURE_SETTINGS — both allowlisted in privapp-permissions-modern-apps.xml. |
| 313 | // It replaces GrapheneOS's Seedvault (com.stevesoltys.seedvault) and the GrapheneOS |
| 314 | // contacts backup transport (app.grapheneos.backup.contacts), both removed in |
| 315 | // modern_apps.mk. It is pinned as the default transport via config_backup_transport |
| 316 | // in the frameworks/base overlay (RRO). Backups are encrypted with a BIP-39 recovery |
| 317 | // code; there is no separate content-provider backend to keep. |
| 318 | android_app_import { |
| 319 | name: "ModernAppsBackup", |
| 320 | apk: "prebuilts/backup-release.apk", |
| 321 | presigned: true, |
| 322 | preprocessed: true, |
| 323 | privileged: true, |
| 324 | product_specific: true, |
| 325 | dex_preopt: { |
| 326 | enabled: false, |
| 327 | }, |
| 328 | } |
| 329 | |
| 330 | // SetupWizard is PRIVILEGED: it is the first-run setup wizard. The platform picks it by |
| 331 | // resolving MAIN against the SETUP_WIZARD and HOME categories, and its intent-filter sits at |
| 332 | // priority 999 so it wins that resolution over the launcher while the device is unprovisioned. |
| 333 | // It sets the system locale, the clock and time zone, and the location master switch, reads |
| 334 | // and clears OEM-unlock state, disables the status bar for the duration of setup, and writes |
| 335 | // DEVICE_PROVISIONED / user_setup_complete to end it - so it needs the signature|privileged |
| 336 | // CHANGE_CONFIGURATION / MANAGE_USER_OEM_UNLOCK_STATE / NETWORK_SETUP_WIZARD / |
| 337 | // READ_PRIVILEGED_PHONE_STATE / READ_OEM_UNLOCK_STATE / REBOOT / SET_TIME / SET_TIME_ZONE / |
| 338 | // STATUS_BAR / WRITE_SECURE_SETTINGS / WRITE_SETTINGS perms, allowlisted in |
| 339 | // privapp-permissions-modern-apps.xml. |
| 340 | // |
| 341 | // It replaces GrapheneOS's SetupWizard2 (app.grapheneos.setupwizard). Both that module and |
| 342 | // AOSP's fallback Provision are dropped by the `overrides` below, which is how GrapheneOS's own |
| 343 | // SetupWizard2 module already drops `Provision` in this tree. Verified mechanism, not a guess: |
| 344 | // soong_app_prebuilt.mk:167 sets PACKAGES.<m>.OVERRIDES for an android_app_import, and |
| 345 | // main.mk:1011-1013 filters overridden modules out of the PRODUCT_PACKAGES-derived list before |
| 346 | // expand-required-modules runs at :1016 (so SetupWizard2's `required:` etc-permissions file |
| 347 | // drops with it, leaving no stale app.grapheneos.setupwizard.xml). |
| 348 | // |
| 349 | // `SetupWizard2` is deliberately LEFT listed in build/make/target/product/handheld_system_ext.mk |
| 350 | // rather than also being deleted there. That line is not redundancy - it is the fallback for |
| 351 | // THIS app going missing. An `overrides` from a module that is not installed does not apply, so |
| 352 | // if the setupwizard prebuilt is ever absent from the image, SetupWizard2 still ships and the |
| 353 | // device still completes setup. Delete that line and the same accident leaves zero activities |
| 354 | // answering SETUP_WIZARD + HOME on an unprovisioned device, which does not boot. Keeping it |
| 355 | // trades a wrong-wizard bug for a brick, in the right direction. |
| 356 | // |
| 357 | // ⚠️ The two must never be separated. With both this app and SetupWizard2 installed, the |
| 358 | // SETUP_WIZARD + HOME resolution is ambiguous; with neither, there is no HOME activity while |
| 359 | // the device is unprovisioned and first boot never completes. |
| 360 | android_app_import { |
| 361 | name: "ModernAppsSetupWizard", |
| 362 | apk: "prebuilts/setupwizard-release.apk", |
| 363 | presigned: true, |
| 364 | preprocessed: true, |
| 365 | privileged: true, |
| 366 | product_specific: true, |
| 367 | overrides: [ |
| 368 | "Provision", |
| 369 | "SetupWizard2", |
| 370 | ], |
| 371 | dex_preopt: { |
| 372 | enabled: false, |
| 373 | }, |
| 374 | } |
| 375 | |
| 376 | |
| 377 | // Updater is PRIVILEGED: it holds REBOOT, ACCESS_CACHE_FILESYSTEM and ALLOCATE_AGGRESSIVE, and |
| 378 | // it drives android.os.UpdateEngine to write an OTA payload into the inactive A/B slot. All |
| 379 | // three are signature|privileged and are allowlisted in privapp-permissions-modern-apps.xml. |
| 380 | // |
| 381 | // `overrides` displaces the GrapheneOS updater outright rather than shipping both. Two update |
| 382 | // clients on one device is not a cosmetic problem: update_engine applies ONE payload at a time |
| 383 | // device-wide, so a second client polling the same server races the first for the slot and the |
| 384 | // loser fails with an error that looks like a corrupt package. |
| 385 | // |
| 386 | // ⚠️ This is the one app whose failure is not self-correcting. If this client is broken and the |
| 387 | // GrapheneOS one is gone, the device cannot update in place and needs a manual flash. It fails |
| 388 | // SAFE only in the sense that `overrides` is conditional on this module existing: a missing |
| 389 | // prebuilt leaves app.seamlessupdate.client in the image. It does NOT protect against ours |
| 390 | // shipping and then not working. Prove an end-to-end update on a real device before trusting it. |
| 391 | android_app_import { |
| 392 | name: "ModernAppsUpdater", |
| 393 | apk: "prebuilts/updater-release.apk", |
| 394 | presigned: true, |
| 395 | preprocessed: true, |
| 396 | privileged: true, |
| 397 | product_specific: true, |
| 398 | overrides: [ |
| 399 | "Updater", |
| 400 | ], |
| 401 | dex_preopt: { |
| 402 | enabled: false, |
| 403 | }, |
| 404 | } |
| 405 | |
| 406 | // Auto is PRIVILEGED: it is the SYSTEM_AUTOMOTIVE_PROJECTION role holder (pinned via |
| 407 | // config_systemAutomotiveProjection in MaosFrameworkResRRO) and exercises signature|privileged |
| 408 | // operations (MANAGE_USB, MODIFY_AUDIO_ROUTING, CALL_PRIVILEGED, CONTROL_INCALL_EXPERIENCE |
| 409 | // and friends, allowlisted in privapp-permissions-modern-apps.xml). It ships its GAL |
| 410 | // credential in assets; the leaf expires 2026-12-09 and must be re-extracted per release |
| 411 | // (auto/docs/HANDOFF.md section 7 runbook). |
| 412 | // |
| 413 | // NOTE: the prebuilt (prebuilts/auto-release.apk) is staged by scripts/collect-apks.sh |
| 414 | // from the Modern-Apps release; until it exists the Soong module dangles and the build |
| 415 | // fails on the missing APK. Stage it before building. |
| 416 | android_app_import { |
| 417 | name: "ModernAppsAuto", |
| 418 | apk: "prebuilts/auto-release.apk", |
| 419 | presigned: true, |
| 420 | preprocessed: true, |
| 421 | privileged: true, |
| 422 | product_specific: true, |
| 423 | dex_preopt: { |
| 424 | enabled: false, |
| 425 | }, |
| 426 | } |
| 427 | |
| 428 | // ParentalControls is the SYSTEM_SUPERVISION role holder - the piece AOSP leaves empty and Google |
| 429 | // fills with a GMS component. The framework (android.app.supervision, SupervisionService) and |
| 430 | // the entire Settings UI (com/android/settings/supervision) already ship in this tree, and the |
| 431 | // gating flag android.app.supervision.flags.enable_supervision_settings_screen is on. What was |
| 432 | // missing is a package answering the supervision messenger bind action, resolved through |
| 433 | // config_systemSupervision: with no holder, TopLevelSupervisionPreferenceController reports |
| 434 | // UNSUPPORTED_ON_DEVICE and Settings > Parental controls does not exist at all - which is why |
| 435 | // MAOS looked like it had no parental controls rather than merely unconfigured ones. |
| 436 | // |
| 437 | // NOT privileged, and deliberately absent from privapp-permissions-modern-apps.xml. It declares |
| 438 | // only role-granted permissions in its manifest; everything it holds arrives with the role, which is |
| 439 | // `signature|role` rather than `signature|privileged`, so an allowlist entry would be both |
| 440 | // wrong and boot-fatal under ro.control_privapp_permissions=enforce. The role's |
| 441 | // systemOnly="true" is satisfied by being preinstalled under /product. The pin, and the full |
| 442 | // list of what holding the role auto-grants, are recorded at the pin itself in |
| 443 | // rro/MaosFrameworkResRRO/res/values/config.xml. |
| 444 | android_app_import { |
| 445 | name: "ModernAppsParentalControls", |
| 446 | apk: "prebuilts/parentalcontrols-release.apk", |
| 447 | presigned: true, |
| 448 | preprocessed: true, |
| 449 | product_specific: true, |
| 450 | dex_preopt: { |
| 451 | enabled: false, |
| 452 | }, |
| 453 | } |
| 454 | |
| 455 | // ScreenTime is the self-managed wellbeing app (dashboard, timers, focus, wind-down). It |
| 456 | // holds the SYSTEM_WELLBEING role via the config_systemWellbeing pin in MaosFrameworkResRRO, |
| 457 | // which grants SUSPEND_APPS, SYSTEM_APPLICATION_OVERLAY and OBSERVE_APP_USAGE at runtime. It |
| 458 | // is NOT privileged: a privapp-permissions entry for a non-priv-app is boot-fatal under |
| 459 | // ro.control_privapp_permissions=enforce. Its reflective UsageStatsManager observer and |
| 460 | // PackageManager suspend access is allowlisted via hidden-api-whitelisted-app in |
| 461 | // sysconfig-modern-apps.xml. |
| 462 | android_app_import { |
| 463 | name: "ModernAppsScreenTime", |
| 464 | apk: "prebuilts/screentime-release.apk", |
| 465 | presigned: true, |
| 466 | preprocessed: true, |
| 467 | product_specific: true, |
| 468 | dex_preopt: { |
| 469 | enabled: false, |
| 470 | }, |
| 471 | } |
| 472 | |
| 473 | // Health is an ordinary user app (metrics, medications, vaccinations): it replaces nothing |
| 474 | // GrapheneOS ships and holds no signature|privileged permission, so it is not `privileged: |
| 475 | // true` and needs no privapp-permissions entry. Preinstalled only so a fresh device has it; |
| 476 | // everything it uses (Health Connect, notifications) is user-granted at runtime, exactly as |
| 477 | // from a store install. |
| 478 | android_app_import { |
| 479 | name: "ModernAppsHealth", |
| 480 | apk: "prebuilts/health-release.apk", |
| 481 | presigned: true, |
| 482 | preprocessed: true, |
| 483 | product_specific: true, |
| 484 | dex_preopt: { |
| 485 | enabled: false, |
| 486 | }, |
| 487 | } |
| 488 | |
| 489 | // Emergency is the emergency-info + SOS app. It REPLACES AOSP's EmergencyInfo |
| 490 | // (com.android.emergency): platform_build.patch swaps EmergencyInfo out of |
| 491 | // telephony_system_ext.mk, and the `overrides` below covers the case where both |
| 492 | // ever ship together. It becomes the android.app.role.EMERGENCY holder |
| 493 | // automatically: EmergencyRoleBehavior has no config_defaultEmergency pin - it grants |
| 494 | // the role to the sole preinstalled package with an |
| 495 | // android.telephony.action.EMERGENCY_ASSISTANCE activity, which is this app once EmergencyInfo |
| 496 | // is gone (our ViewInfoActivity answers that action). |
| 497 | // |
| 498 | // PRIVILEGED: it declares signature|privileged perms - CALL_PRIVILEGED (place the emergency |
| 499 | // call), WRITE_SECURE_SETTINGS (the gesture provider EMERGENCY_GESTURE_* writes), |
| 500 | // READ_PRIVILEGED_PHONE_STATE (emergency-number lookup), MANAGE_USERS (owner card), |
| 501 | // START_ACTIVITIES_FROM_BACKGROUND (SOS background alarm) and SCHEDULE_EXACT_ALARM |
| 502 | // (SOS countdown) - allowlisted in privapp-permissions-modern-apps.xml. Its Health Connect medical reads and |
| 503 | // contacts access are default-granted (fixed) in default-permissions-modern-apps.xml so an |
| 504 | // emergency needs no manual permission setup. |
| 505 | android_app_import { |
| 506 | name: "ModernAppsEmergency", |
| 507 | apk: "prebuilts/emergency-release.apk", |
| 508 | presigned: true, |
| 509 | preprocessed: true, |
| 510 | privileged: true, |
| 511 | product_specific: true, |
| 512 | overrides: [ |
| 513 | "EmergencyInfo", |
| 514 | ], |
| 515 | dex_preopt: { |
| 516 | enabled: false, |
| 517 | }, |
| 518 | } |