soong_namespace { } // Modern Apps prebuilt userspace apps for MAOS (Modern Apps OS). // // Each app ships as an android_app_import so its existing com.vayunmathur signing // certificate (the README SHA-256 cert) is preserved via `presigned: true`. Do NOT // port these Gradle/Compose apps to Soong. // // APKs live in prebuilts/ and are populated by scripts/collect-apks.sh before a build. android_app_import { name: "ModernAppsWeb", apk: "prebuilts/web-release.apk", presigned: true, preprocessed: true, product_specific: true, dex_preopt: { enabled: false, }, } android_app_import { name: "ModernAppsCamera", apk: "prebuilts/camera-release.apk", presigned: true, preprocessed: true, product_specific: true, dex_preopt: { enabled: false, }, } android_app_import { name: "ModernAppsPdf", apk: "prebuilts/pdf-release.apk", presigned: true, preprocessed: true, product_specific: true, dex_preopt: { enabled: false, }, } android_app_import { name: "ModernAppsContacts", apk: "prebuilts/contacts-release.apk", presigned: true, preprocessed: true, product_specific: true, dex_preopt: { enabled: false, }, } android_app_import { name: "ModernAppsCalculator", apk: "prebuilts/calculator-release.apk", presigned: true, preprocessed: true, product_specific: true, dex_preopt: { enabled: false, }, } android_app_import { name: "ModernAppsClock", apk: "prebuilts/clock-release.apk", presigned: true, preprocessed: true, product_specific: true, dex_preopt: { enabled: false, }, } // Files is PRIVILEGED: in the system build it absorbs DocumentsUI's Storage Access // Framework role and therefore needs the signature|privileged MANAGE_DOCUMENTS // permission, allowlisted in privapp-permissions-modern-apps.xml. It installs to // /product/priv-app. The SAF picker UI itself is implemented in the Files app's // system build variant (Modern-Apps repo), not here. android_app_import { name: "ModernAppsFiles", apk: "prebuilts/files-release.apk", presigned: true, preprocessed: true, privileged: true, product_specific: true, dex_preopt: { enabled: false, }, } android_app_import { name: "ModernAppsPhotos", apk: "prebuilts/photos-release.apk", presigned: true, preprocessed: true, product_specific: true, dex_preopt: { enabled: false, }, } android_app_import { name: "ModernAppsStore", apk: "prebuilts/appstore-release.apk", presigned: true, preprocessed: true, privileged: true, product_specific: true, dex_preopt: { enabled: false, }, } // Keyboard replaces AOSP LatinIME as the system IME. Direct Boot support (for lock-screen // input after a reboot) is declared in the keyboard app's own manifest, not here. android_app_import { name: "ModernAppsKeyboard", apk: "prebuilts/keyboard-release.apk", presigned: true, preprocessed: true, product_specific: true, dex_preopt: { enabled: false, }, } // Speech is the default on-device STT (RecognitionService) and TTS (TextToSpeech) engine. // Replaces GrapheneOS's SpeechServices (removed in modern_apps.mk). Wired up via // config_default*SpeechRecognitionService and, for TTS, by being the only installed engine. android_app_import { name: "ModernAppsSpeech", apk: "prebuilts/speech-release.apk", presigned: true, preprocessed: true, product_specific: true, dex_preopt: { enabled: false, }, } // NetworkLocation is PRIVILEGED: it provides both the network location provider and the // offline geocoder, replacing GrapheneOS's NetworkLocation (removed in modern_apps.mk). It // needs the signature|privileged INSTALL_LOCATION_PROVIDER / LOCATION_HARDWARE / // MODIFY_PHONE_STATE / UPDATE_DEVICE_STATS perms (allowlisted in // privapp-permissions-modern-apps.xml) and is pinned via config_networkLocationProviderPackageName // and config_geocoderProviderPackageName in the frameworks/base overlay. android_app_import { name: "ModernAppsNetworkLocation", apk: "prebuilts/networklocation-release.apk", presigned: true, preprocessed: true, privileged: true, product_specific: true, dex_preopt: { enabled: false, }, } // Calendar replaces the stock AOSP Calendar (com.android.calendar, module Calendar). Uses the // system CalendarProvider via CalendarContract — no backend of its own. android_app_import { name: "ModernAppsCalendar", apk: "prebuilts/calendar-release.apk", presigned: true, preprocessed: true, product_specific: true, dex_preopt: { enabled: false, }, } // Music replaces AOSP Music (com.android.music, module Music). Includes a popup single-file // player (.AudioPreview equivalent) for audio VIEW intents. android_app_import { name: "ModernAppsMusic", apk: "prebuilts/music-release.apk", presigned: true, preprocessed: true, product_specific: true, dex_preopt: { enabled: false, }, } // Communicate is a unified dialer + messaging app. It replaces BOTH GrapheneOS's Dialer // (com.android.dialer, module Dialer) and Messaging (com.android.messaging, module Messaging), // which are removed in modern_apps.mk. It becomes the default dialer and default SMS app via // config_defaultDialer / config_defaultSms in the frameworks/base overlay (RRO). It holds the // DIALER and SMS roles (declares an InCallService and the SMS_DELIVER/WAP_PUSH_DELIVER // receivers); the role system auto-grants its runtime permissions, so it is NOT privileged and // needs no default-permissions grant. The telephony backends (TelephonyProvider, telecom // framework) are untouched — only the UI apps are removed. android_app_import { name: "ModernAppsCommunicate", apk: "prebuilts/communicate-release.apk", presigned: true, preprocessed: true, product_specific: true, dex_preopt: { enabled: false, }, } // FindFamily and Share are ordinary user apps, not system components: they replace nothing // GrapheneOS ships and hold no signature|privileged permission, so neither is `privileged: // true` and neither needs a privapp-permissions entry. They are preinstalled only so a fresh // device has them available; everything they use (location, contacts, nearby-device Bluetooth) // is a runtime permission the user grants, exactly as it would be from a store install. android_app_import { name: "ModernAppsFindFamily", apk: "prebuilts/findfamily-release.apk", presigned: true, preprocessed: true, product_specific: true, dex_preopt: { enabled: false, }, } // Share is PRIVILEGED for AirDrop over Google's Mosey (AWDL) HAL: publishing the `mosey0` // interface as a network needs CREATE_APP_SPECIFIC_NETWORK, and binding sockets/mDNS to that // restricted network needs CONNECTIVITY_USE_RESTRICTED_NETWORKS. Both are signature|privileged // and allowlisted in privapp-permissions-modern-apps.xml. Without a Mosey HAL on the device the // app falls back to AirDrop over the Wi-Fi LAN and these permissions go unused. android_app_import { name: "ModernAppsShare", apk: "prebuilts/share-release.apk", presigned: true, preprocessed: true, privileged: true, product_specific: true, dex_preopt: { enabled: false, }, } // Cast is PRIVILEGED: it is a remote display provider, and // RemoteDisplayProviderWatcher.verifyServiceTrusted only trusts a provider whose app holds // android.permission.REMOTE_DISPLAY_PROVIDER (signature|privileged). Without that the // watcher logs and skips the service and Settings' Cast page stays empty. It also needs // START_ACTIVITIES_FROM_BACKGROUND to reach the screen-capture consent activity from the // bound service. Both are allowlisted in privapp-permissions-modern-apps.xml. // // The TV receiver (com.vayunmathur.cast.tv) is deliberately NOT preinstalled: it targets a // television, not a phone. android_app_import { name: "ModernAppsCast", apk: "prebuilts/cast-release.apk", presigned: true, preprocessed: true, privileged: true, product_specific: true, dex_preopt: { enabled: false, }, } // LogViewer is PRIVILEGED: it replaces GrapheneOS's app.grapheneos.logviewer (module // LogViewer, removed from handheld_system.mk) and holds the same permissions it did. // READ_LOGS, READ_LOGS_FULL, READ_OEM_UNLOCK_STATE and QUERY_USERS are allowlisted in // privapp-permissions-modern-apps.xml; a missing entry there is a boot failure, not a // degraded feature. Without READ_LOGS in particular logd filters logcat down to our own // uid and the log simply looks EMPTY - exit code 0, no error. // // It declares two permissions of its own, com.vayunmathur.logviewer.SHOW_LOGCAT // (signature|privileged) and .SHOW_ERROR_REPORT (signature|preinstalled), which is how // Settings and the system crash dialog are allowed to open it. There is deliberately no // launcher entry: both activities are permission-guarded and reached by intent. // // frameworks/base/core/java/android/ext/LogViewerApp.java is patched to this package name; // it is the producer of every error-report intent and addresses them with setPackage(). android_app_import { name: "ModernAppsLogViewer", apk: "prebuilts/logviewer-release.apk", presigned: true, preprocessed: true, privileged: true, product_specific: true, dex_preopt: { enabled: false, }, } // Euicc is PRIVILEGED: it is the system eSIM LPA (Local Profile Assistant). It declares the // android.service.euicc.EuiccService and the eSIM management LUI, and drives the eUICC over a // telephony logical channel, so it needs the signature|privileged WRITE_EMBEDDED_SUBSCRIPTIONS / // MODIFY_PHONE_STATE / READ_PRIVILEGED_PHONE_STATE perms (allowlisted in // privapp-permissions-modern-apps.xml). It replaces Google's LPA app EuiccGoogle // (com.google.android.euicc, removed in modern_apps.mk). The proprietary Pixel hardware backend // EuiccSupportPixel (com.google.euiccpixel) and the modem firmware are KEPT — they provide the // low-level access to the built-in eUICC that this app sits on top of. android_app_import { name: "ModernAppsEuicc", apk: "prebuilts/euicc-release.apk", presigned: true, preprocessed: true, privileged: true, product_specific: true, dex_preopt: { enabled: false, }, } // Backup is PRIVILEGED: it is the system app-data backup transport (declares // android.app.backup.BackupTransport via a TRANSPORT_HOST service) and also does // standalone encrypted file/media backup. Being the transport requires the // signature|privileged BACKUP permission, and setting itself active requires // WRITE_SECURE_SETTINGS — both allowlisted in privapp-permissions-modern-apps.xml. // It replaces GrapheneOS's Seedvault (com.stevesoltys.seedvault) and the GrapheneOS // contacts backup transport (app.grapheneos.backup.contacts), both removed in // modern_apps.mk. It is pinned as the default transport via config_backup_transport // in the frameworks/base overlay (RRO). Backups are encrypted with a BIP-39 recovery // code; there is no separate content-provider backend to keep. android_app_import { name: "ModernAppsBackup", apk: "prebuilts/backup-release.apk", presigned: true, preprocessed: true, privileged: true, product_specific: true, dex_preopt: { enabled: false, }, } // SetupWizard is PRIVILEGED: it is the first-run setup wizard. The platform picks it by // resolving MAIN against the SETUP_WIZARD and HOME categories, and its intent-filter sits at // priority 999 so it wins that resolution over the launcher while the device is unprovisioned. // It sets the system locale, the clock and time zone, and the location master switch, reads // and clears OEM-unlock state, disables the status bar for the duration of setup, and writes // DEVICE_PROVISIONED / user_setup_complete to end it - so it needs the signature|privileged // CHANGE_CONFIGURATION / MANAGE_USER_OEM_UNLOCK_STATE / NETWORK_SETUP_WIZARD / // READ_PRIVILEGED_PHONE_STATE / READ_OEM_UNLOCK_STATE / REBOOT / SET_TIME / SET_TIME_ZONE / // STATUS_BAR / WRITE_SECURE_SETTINGS / WRITE_SETTINGS perms, allowlisted in // privapp-permissions-modern-apps.xml. // // It replaces GrapheneOS's SetupWizard2 (app.grapheneos.setupwizard). Both that module and // AOSP's fallback Provision are dropped by the `overrides` below, which is how GrapheneOS's own // SetupWizard2 module already drops `Provision` in this tree. Verified mechanism, not a guess: // soong_app_prebuilt.mk:167 sets PACKAGES..OVERRIDES for an android_app_import, and // main.mk:1011-1013 filters overridden modules out of the PRODUCT_PACKAGES-derived list before // expand-required-modules runs at :1016 (so SetupWizard2's `required:` etc-permissions file // drops with it, leaving no stale app.grapheneos.setupwizard.xml). // // `SetupWizard2` is deliberately LEFT listed in build/make/target/product/handheld_system_ext.mk // rather than also being deleted there. That line is not redundancy - it is the fallback for // THIS app going missing. An `overrides` from a module that is not installed does not apply, so // if the setupwizard prebuilt is ever absent from the image, SetupWizard2 still ships and the // device still completes setup. Delete that line and the same accident leaves zero activities // answering SETUP_WIZARD + HOME on an unprovisioned device, which does not boot. Keeping it // trades a wrong-wizard bug for a brick, in the right direction. // // ⚠️ The two must never be separated. With both this app and SetupWizard2 installed, the // SETUP_WIZARD + HOME resolution is ambiguous; with neither, there is no HOME activity while // the device is unprovisioned and first boot never completes. android_app_import { name: "ModernAppsSetupWizard", apk: "prebuilts/setupwizard-release.apk", presigned: true, preprocessed: true, privileged: true, product_specific: true, overrides: [ "Provision", "SetupWizard2", ], dex_preopt: { enabled: false, }, } // Updater is PRIVILEGED: it holds REBOOT, ACCESS_CACHE_FILESYSTEM and ALLOCATE_AGGRESSIVE, and // it drives android.os.UpdateEngine to write an OTA payload into the inactive A/B slot. All // three are signature|privileged and are allowlisted in privapp-permissions-modern-apps.xml. // // `overrides` displaces the GrapheneOS updater outright rather than shipping both. Two update // clients on one device is not a cosmetic problem: update_engine applies ONE payload at a time // device-wide, so a second client polling the same server races the first for the slot and the // loser fails with an error that looks like a corrupt package. // // ⚠️ This is the one app whose failure is not self-correcting. If this client is broken and the // GrapheneOS one is gone, the device cannot update in place and needs a manual flash. It fails // SAFE only in the sense that `overrides` is conditional on this module existing: a missing // prebuilt leaves app.seamlessupdate.client in the image. It does NOT protect against ours // shipping and then not working. Prove an end-to-end update on a real device before trusting it. android_app_import { name: "ModernAppsUpdater", apk: "prebuilts/updater-release.apk", presigned: true, preprocessed: true, privileged: true, product_specific: true, overrides: [ "Updater", ], dex_preopt: { enabled: false, }, } // Auto is PRIVILEGED: it is the SYSTEM_AUTOMOTIVE_PROJECTION role holder (pinned via // config_systemAutomotiveProjection in MaosFrameworkResRRO) and exercises signature|privileged // operations (MANAGE_USB, MODIFY_AUDIO_ROUTING, CALL_PRIVILEGED, CONTROL_INCALL_EXPERIENCE // and friends, allowlisted in privapp-permissions-modern-apps.xml). It ships its GAL // credential in assets; the leaf expires 2026-12-09 and must be re-extracted per release // (auto/docs/HANDOFF.md section 7 runbook). // // NOTE: the prebuilt (prebuilts/auto-release.apk) is staged by scripts/collect-apks.sh // from the Modern-Apps release; until it exists the Soong module dangles and the build // fails on the missing APK. Stage it before building. android_app_import { name: "ModernAppsAuto", apk: "prebuilts/auto-release.apk", presigned: true, preprocessed: true, privileged: true, product_specific: true, dex_preopt: { enabled: false, }, } // ParentalControls is the SYSTEM_SUPERVISION role holder - the piece AOSP leaves empty and Google // fills with a GMS component. The framework (android.app.supervision, SupervisionService) and // the entire Settings UI (com/android/settings/supervision) already ship in this tree, and the // gating flag android.app.supervision.flags.enable_supervision_settings_screen is on. What was // missing is a package answering the supervision messenger bind action, resolved through // config_systemSupervision: with no holder, TopLevelSupervisionPreferenceController reports // UNSUPPORTED_ON_DEVICE and Settings > Parental controls does not exist at all - which is why // MAOS looked like it had no parental controls rather than merely unconfigured ones. // // NOT privileged, and deliberately absent from privapp-permissions-modern-apps.xml. It declares // only role-granted permissions in its manifest; everything it holds arrives with the role, which is // `signature|role` rather than `signature|privileged`, so an allowlist entry would be both // wrong and boot-fatal under ro.control_privapp_permissions=enforce. The role's // systemOnly="true" is satisfied by being preinstalled under /product. The pin, and the full // list of what holding the role auto-grants, are recorded at the pin itself in // rro/MaosFrameworkResRRO/res/values/config.xml. android_app_import { name: "ModernAppsParentalControls", apk: "prebuilts/parentalcontrols-release.apk", presigned: true, preprocessed: true, product_specific: true, dex_preopt: { enabled: false, }, } // ScreenTime is the self-managed wellbeing app (dashboard, timers, focus, wind-down). It // holds the SYSTEM_WELLBEING role via the config_systemWellbeing pin in MaosFrameworkResRRO, // which grants SUSPEND_APPS, SYSTEM_APPLICATION_OVERLAY and OBSERVE_APP_USAGE at runtime. It // is NOT privileged: a privapp-permissions entry for a non-priv-app is boot-fatal under // ro.control_privapp_permissions=enforce. Its reflective UsageStatsManager observer and // PackageManager suspend access is allowlisted via hidden-api-whitelisted-app in // sysconfig-modern-apps.xml. android_app_import { name: "ModernAppsScreenTime", apk: "prebuilts/screentime-release.apk", presigned: true, preprocessed: true, product_specific: true, dex_preopt: { enabled: false, }, } // Health is an ordinary user app (metrics, medications, vaccinations): it replaces nothing // GrapheneOS ships and holds no signature|privileged permission, so it is not `privileged: // true` and needs no privapp-permissions entry. Preinstalled only so a fresh device has it; // everything it uses (Health Connect, notifications) is user-granted at runtime, exactly as // from a store install. android_app_import { name: "ModernAppsHealth", apk: "prebuilts/health-release.apk", presigned: true, preprocessed: true, product_specific: true, dex_preopt: { enabled: false, }, } // Emergency is the emergency-info + SOS app. It REPLACES AOSP's EmergencyInfo // (com.android.emergency): platform_build.patch swaps EmergencyInfo out of // telephony_system_ext.mk, and the `overrides` below covers the case where both // ever ship together. It becomes the android.app.role.EMERGENCY holder // automatically: EmergencyRoleBehavior has no config_defaultEmergency pin - it grants // the role to the sole preinstalled package with an // android.telephony.action.EMERGENCY_ASSISTANCE activity, which is this app once EmergencyInfo // is gone (our ViewInfoActivity answers that action). // // PRIVILEGED: it declares signature|privileged perms - CALL_PRIVILEGED (place the emergency // call), WRITE_SECURE_SETTINGS (the gesture provider EMERGENCY_GESTURE_* writes), // READ_PRIVILEGED_PHONE_STATE (emergency-number lookup), MANAGE_USERS (owner card), // START_ACTIVITIES_FROM_BACKGROUND (SOS background alarm) and SCHEDULE_EXACT_ALARM // (SOS countdown) - allowlisted in privapp-permissions-modern-apps.xml. Its Health Connect medical reads and // contacts access are default-granted (fixed) in default-permissions-modern-apps.xml so an // emergency needs no manual permission setup. android_app_import { name: "ModernAppsEmergency", apk: "prebuilts/emergency-release.apk", presigned: true, preprocessed: true, privileged: true, product_specific: true, overrides: [ "EmergencyInfo", ], dex_preopt: { enabled: false, }, }