Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / updater / src / main / AndroidManifest.xml
AndroidManifest.xml102 lines · 5.1 KiBRaw
| 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | |
| 4 | <uses-permission android:name="android.permission.INTERNET" /> |
| 5 | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
| 6 | <uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> |
| 7 | <!-- Live Updates (API 36 ProgressStyle promoted ongoing): install-time, no runtime prompt. --> |
| 8 | <uses-permission android:name="android.permission.POST_PROMOTED_NOTIFICATIONS" /> |
| 9 | <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> |
| 10 | <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> |
| 11 | <uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" /> |
| 12 | <uses-permission android:name="android.permission.WAKE_LOCK" /> |
| 13 | |
| 14 | <!-- |
| 15 | signature|privileged, so all four require an entry in |
| 16 | vendor/modern-apps/privapp-permissions-modern-apps.xml whose package= byte-matches |
| 17 | com.vayunmathur.updater. A mismatch there is boot-fatal under |
| 18 | ro.control_privapp_permissions=enforce, not a silent no-op. |
| 19 | --> |
| 20 | <!-- Reboot into the freshly written slot once the payload is applied. --> |
| 21 | <uses-permission android:name="android.permission.REBOOT" /> |
| 22 | <!-- update_engine stages payload metadata under /cache. --> |
| 23 | <uses-permission android:name="android.permission.ACCESS_CACHE_FILESYSTEM" /> |
| 24 | <!-- Lets update_engine reclaim space aggressively when the inactive slot is tight. --> |
| 25 | <uses-permission android:name="android.permission.ALLOCATE_AGGRESSIVE" /> |
| 26 | |
| 27 | <application |
| 28 | android:allowBackup="false" |
| 29 | android:dataExtractionRules="@xml/data_extraction_rules" |
| 30 | android:icon="@mipmap/ic_launcher" |
| 31 | android:label="@string/app_name" |
| 32 | android:roundIcon="@mipmap/ic_launcher" |
| 33 | android:supportsRtl="true" |
| 34 | android:theme="@style/Theme.General"> |
| 35 | |
| 36 | <!-- |
| 37 | **Not a launcher activity.** An OTA client is something the user goes looking for in |
| 38 | Settings, under System > System update, rather than an app they open - so it answers |
| 39 | `android.settings.SYSTEM_UPDATE_SETTINGS` and shows no icon. |
| 40 | |
| 41 | That action is exactly what `SystemUpdateRepository.getSystemUpdateIntent` resolves, with |
| 42 | `MATCH_SYSTEM_ONLY`; the preference is *removed* from the System screen when nothing |
| 43 | answers it, which is why the row was missing rather than merely inert. Being preinstalled |
| 44 | under /product satisfies the system-only match. |
| 45 | |
| 46 | `exported` stays true because the caller is Settings, in another process. |
| 47 | --> |
| 48 | <activity |
| 49 | android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" |
| 50 | android:name=".MainActivity" |
| 51 | android:exported="true" |
| 52 | android:launchMode="singleTask" |
| 53 | android:theme="@style/Theme.General"> |
| 54 | <intent-filter> |
| 55 | <action android:name="android.settings.SYSTEM_UPDATE_SETTINGS" /> |
| 56 | <category android:name="android.intent.category.DEFAULT" /> |
| 57 | </intent-filter> |
| 58 | </activity> |
| 59 | |
| 60 | <!-- |
| 61 | specialUse, not dataSync: Android 15 caps dataSync at six cumulative hours a day and |
| 62 | Android 13/14 refuse to let a boot receiver start one. Neither suits a 1-2 GB transfer |
| 63 | followed by an A/B slot write that must not be abandoned halfway. |
| 64 | --> |
| 65 | <service |
| 66 | android:name=".service.UpdateInstallService" |
| 67 | android:exported="false" |
| 68 | android:foregroundServiceType="specialUse"> |
| 69 | <property |
| 70 | android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE" |
| 71 | android:value="Downloads, signature-verifies and applies a full system OTA to the inactive A/B slot. The transfer is 1-2 GB and the slot write cannot be interrupted partway without leaving the update unusable." /> |
| 72 | </service> |
| 73 | |
| 74 | <!-- |
| 75 | BIND_JOB_SERVICE is required by the platform for any JobService. Idle detection is |
| 76 | the scheduler's (setRequiresDeviceIdle), not ours. |
| 77 | --> |
| 78 | <service |
| 79 | android:name=".platform.IdleReboot" |
| 80 | android:exported="false" |
| 81 | android:permission="android.permission.BIND_JOB_SERVICE" /> |
| 82 | |
| 83 | <!-- Re-schedules the periodic check; see the class doc for why it does not install. --> |
| 84 | <receiver |
| 85 | android:name=".platform.UpdateBootReceiver" |
| 86 | android:exported="false"> |
| 87 | <intent-filter> |
| 88 | <action android:name="android.intent.action.BOOT_COMPLETED" /> |
| 89 | <action android:name="android.intent.action.MY_PACKAGE_REPLACED" /> |
| 90 | </intent-filter> |
| 91 | </receiver> |
| 92 | |
| 93 | <!-- |
| 94 | Not exported: the only intent it accepts comes from this app's own PendingIntent on |
| 95 | the update-ready notification, and what it does is reboot the device. |
| 96 | --> |
| 97 | <receiver |
| 98 | android:name=".platform.RebootReceiver" |
| 99 | android:exported="false" /> |
| 100 | </application> |
| 101 | |
| 102 | </manifest> |