Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / screentime / src / main / AndroidManifest.xml
AndroidManifest.xml160 lines · 8.7 KiBRaw
| 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | xmlns:tools="http://schemas.android.com/tools"> |
| 4 | <!-- |
| 5 | Everything this app holds arrives with the SYSTEM_WELLBEING role, which the platform |
| 6 | grants to whichever package `config_systemWellbeing` names - see the pin in |
| 7 | vendor/modern-apps/rro/MaosFrameworkResRRO/res/values/config.xml. The role grants |
| 8 | SUSPEND_APPS, SYSTEM_APPLICATION_OVERLAY and OBSERVE_APP_USAGE (all |
| 9 | signature|privileged|role or signature|role), which is why those three are declared |
| 10 | without apology below: a role grants only what the manifest requests. |
| 11 | |
| 12 | Neither belongs in privapp-permissions-modern-apps.xml. This app is not a priv-app, and |
| 13 | an entry there that does not match the manifest is boot-fatal under |
| 14 | ro.control_privapp_permissions=enforce. |
| 15 | --> |
| 16 | <!-- Pauses apps whose timer ran out or that focus mode covers. Arrives via the role. --> |
| 17 | <uses-permission android:name="android.permission.SUSPEND_APPS" /> |
| 18 | <!-- Friction sheets and the expired-timer screen draw over the opening app. Via the role. --> |
| 19 | <uses-permission android:name="android.permission.SYSTEM_APPLICATION_OVERLAY" /> |
| 20 | <!-- Time-based callbacks when an app reaches a usage threshold. Via the role. --> |
| 21 | <uses-permission android:name="android.permission.OBSERVE_APP_USAGE" /> |
| 22 | <!-- Reads per-app foreground time for the dashboard. An appop, not a role grant: declared |
| 23 | here but stays denied until granted in Settings or self-granted - see UsageAccess. --> |
| 24 | <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" |
| 25 | tools:ignore="ProtectedPermissions" /> |
| 26 | <!-- Lets UsageAccess set the usage-stats app-op on our own uid. Declared like parental |
| 27 | controls does; the role grant supplies the privilege. --> |
| 28 | <uses-permission android:name="android.permission.MANAGE_APP_OPS_MODES" |
| 29 | tools:ignore="ProtectedPermissions" /> |
| 30 | <!-- The wind-down schedule arms exact alarms for window edges. --> |
| 31 | <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" /> |
| 32 | <!-- Re-arms schedules and observers after a restart. --> |
| 33 | <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> |
| 34 | <!-- The dashboard and pickers list launchable apps. --> |
| 35 | <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" |
| 36 | tools:ignore="QueryAllPackagesPermission" /> |
| 37 | <!-- Timer/friction notices. A normal runtime permission. --> |
| 38 | <uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> |
| 39 | <!-- Wind-down couples to Do Not Disturb. Normal permission; the user grants the |
| 40 | policy access once in Settings, after which the schedule toggles it directly. --> |
| 41 | <uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" /> |
| 42 | |
| 43 | <!-- Not requested, deliberately: no INTERNET. Usage stays on the device - the dashboard, |
| 44 | timers, pauses and bedtime are all local, and there is no account to sync to. --> |
| 45 | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" |
| 46 | tools:node="remove" /> |
| 47 | |
| 48 | <application |
| 49 | android:allowBackup="false" |
| 50 | android:dataExtractionRules="@xml/data_extraction_rules" |
| 51 | android:icon="@mipmap/ic_launcher" |
| 52 | android:label="@string/app_name" |
| 53 | android:roundIcon="@mipmap/ic_launcher" |
| 54 | android:supportsRtl="true" |
| 55 | android:theme="@style/Theme.General"> |
| 56 | <!-- |
| 57 | The dashboard. Reached from Settings only - no launcher icon. The intent-filter |
| 58 | below registers the activity as a Settings row (ia.homepage + summary), so |
| 59 | Settings > Digital Wellbeing and search land on the dashboard alongside |
| 60 | Wind Down. Stock Wellbeing spreads its rows across homepage/apps/gestures/bedtime |
| 61 | with summary URIs; ours registers the same homepage rows against our own activities. |
| 62 | --> |
| 63 | <activity |
| 64 | android:name=".ui.DashboardActivity" |
| 65 | android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" |
| 66 | android:exported="true" |
| 67 | android:label="@string/app_name" |
| 68 | android:theme="@style/Theme.General"> |
| 69 | <intent-filter> |
| 70 | <action android:name="com.vayunmathur.screentime.action.DASHBOARD" /> |
| 71 | <category android:name="android.intent.category.DEFAULT" /> |
| 72 | </intent-filter> |
| 73 | <meta-data |
| 74 | android:name="com.android.settings.category" |
| 75 | android:value="com.android.settings.category.ia.homepage" /> |
| 76 | <meta-data |
| 77 | android:name="com.android.settings.summary" |
| 78 | android:resource="@string/dashboard_summary" /> |
| 79 | </activity> |
| 80 | |
| 81 | <!-- |
| 82 | Settings rows. Stock Wellbeing spreads these across the homepage, apps, gestures and |
| 83 | bedtime categories with summary URIs; ours registers the same rows against our own |
| 84 | activities so Settings > Digital Wellbeing (and search) lands here. |
| 85 | --> |
| 86 | <activity |
| 87 | android:name=".ui.WindDownActivity" |
| 88 | android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" |
| 89 | android:exported="true" |
| 90 | android:label="@string/winddown_title" |
| 91 | android:theme="@style/Theme.General"> |
| 92 | <intent-filter> |
| 93 | <action android:name="android.settings.BEDTIME_SETTINGS" /> |
| 94 | <category android:name="android.intent.category.DEFAULT" /> |
| 95 | </intent-filter> |
| 96 | <meta-data |
| 97 | android:name="com.android.settings.category" |
| 98 | android:value="com.android.settings.category.ia.homepage" /> |
| 99 | <meta-data |
| 100 | android:name="com.android.settings.summary" |
| 101 | android:resource="@string/winddown_summary" /> |
| 102 | </activity> |
| 103 | |
| 104 | <activity |
| 105 | android:name=".ui.AppDetailsActivity" |
| 106 | android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" |
| 107 | android:exported="true" |
| 108 | android:label="@string/details_title" |
| 109 | android:theme="@style/Theme.General"> |
| 110 | <intent-filter> |
| 111 | <action android:name="com.vayunmathur.screentime.action.APP_DETAILS" /> |
| 112 | <category android:name="android.intent.category.DEFAULT" /> |
| 113 | </intent-filter> |
| 114 | </activity> |
| 115 | |
| 116 | <!-- |
| 117 | Friction sheets and the expired-timer notice. Started explicitly by our own |
| 118 | receivers and the usage-observer path; never exported, never in the launcher. |
| 119 | showWhenLocked is set in code so the sheet meets the launch, not the home screen. |
| 120 | --> |
| 121 | <activity |
| 122 | android:name=".ui.FrictionActivity" |
| 123 | android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" |
| 124 | android:excludeFromRecents="true" |
| 125 | android:exported="false" |
| 126 | android:launchMode="singleInstance" |
| 127 | android:theme="@style/Theme.General" /> |
| 128 | |
| 129 | <!-- Fired by UsageStatsService when an app spends its timer budget. --> |
| 130 | <receiver |
| 131 | android:name=".receiver.TimerReachedReceiver" |
| 132 | android:exported="false" /> |
| 133 | |
| 134 | <!-- Wind-down window edges. Re-armed each time one fires. --> |
| 135 | <receiver |
| 136 | android:name=".receiver.ScheduleReceiver" |
| 137 | android:exported="false" /> |
| 138 | |
| 139 | <receiver |
| 140 | android:name=".receiver.BootReceiver" |
| 141 | android:exported="true"> |
| 142 | <intent-filter> |
| 143 | <action android:name="android.intent.action.BOOT_COMPLETED" /> |
| 144 | <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" /> |
| 145 | </intent-filter> |
| 146 | </receiver> |
| 147 | |
| 148 | <receiver |
| 149 | android:name=".widget.ScreenTimeGlanceWidgetReceiver" |
| 150 | android:exported="false" |
| 151 | android:label="@string/widget_description"> |
| 152 | <intent-filter> |
| 153 | <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> |
| 154 | </intent-filter> |
| 155 | <meta-data |
| 156 | android:name="android.appwidget.provider" |
| 157 | android:resource="@xml/screentime_widget_info" /> |
| 158 | </receiver> |
| 159 | </application> |
| 160 | </manifest> |