Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
dependencies ▾

Modern-Apps.git / screentime / src / main / AndroidManifest.xml

AndroidManifest.xml200 lines · 10.3 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 <!-- MAOS: opt out of the GrapheneOS Sensors permission (OTHER_SENSORS). -->
18 <!-- This app uses no motion/environment sensors; MAOS withholds the -->
19 <!-- Sensors permission at install instead of auto-granting it. -->
20 <uses-permission android:name="com.vayunmathur.permission.SENSORS_OPTOUT" />
21
22 <uses-permission android:name="android.permission.SUSPEND_APPS"
23 tools:ignore="ProtectedPermissions" />
24 <!-- Friction sheets and the expired-timer screen draw over the opening app. Via the role. -->
25 <uses-permission android:name="android.permission.SYSTEM_APPLICATION_OVERLAY"
26 tools:ignore="ProtectedPermissions" />
27 <!-- Time-based callbacks when an app reaches a usage threshold. Via the role. -->
28 <uses-permission android:name="android.permission.OBSERVE_APP_USAGE"
29 tools:ignore="ProtectedPermissions" />
30 <!-- Reads per-app foreground time for the dashboard. An appop, not a role grant: declared
31 here but stays denied until granted in Settings or self-granted - see UsageAccess. -->
32 <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"
33 tools:ignore="ProtectedPermissions" />
34 <!-- Lets UsageAccess set the usage-stats app-op on our own uid. Declared like parental
35 controls does; the role grant supplies the privilege. -->
36 <uses-permission android:name="android.permission.MANAGE_APP_OPS_MODES"
37 tools:ignore="ProtectedPermissions" />
38 <!-- The wind-down schedule arms exact alarms for window edges. -->
39 <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
40 <!-- Re-arms schedules and observers after a restart. -->
41 <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
42 <!-- The dashboard and pickers list launchable apps. -->
43 <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
44 tools:ignore="QueryAllPackagesPermission" />
45 <!-- Timer/friction notices. A normal runtime permission. -->
46 <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
47
48 <!-- Guards the assistant usage-summary intent below: same-signature callers only. -->
49 <permission
50 android:name="com.vayunmathur.screentime.permissions.ACCESS_SCREENTIME"
51 android:protectionLevel="signature" />
52 <!-- Wind-down couples to Do Not Disturb. Normal permission; the user grants the
53 policy access once in Settings, after which the schedule toggles it directly. -->
54 <uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
55
56 <!-- Not requested, deliberately: no INTERNET. Usage stays on the device - the dashboard,
57 timers, pauses and bedtime are all local, and there is no account to sync to. -->
58 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"
59 tools:node="remove" />
60
61 <application
62 android:allowBackup="false"
63 android:dataExtractionRules="@xml/data_extraction_rules"
64 android:icon="@mipmap/ic_launcher"
65 android:label="@string/app_name"
66 android:roundIcon="@mipmap/ic_launcher"
67 android:supportsRtl="true"
68 android:theme="@style/Theme.General">
69 <!--
70 The single navigation host. Reached from Settings only - no launcher icon.
71 Every former activity entry point below is an alias onto this host, keeping
72 its own label, intent-filter and Settings meta-data, so Settings rows and
73 external intents land exactly where they did; MainActivity.routeFor turns
74 the arriving intent into the start route. singleTask so a second Settings
75 tap re-routes the running host via onNewIntent instead of stacking hosts.
76 -->
77 <activity
78 android:name=".MainActivity"
79 android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
80 android:exported="true"
81 android:launchMode="singleTask"
82 android:theme="@style/Theme.General" />
83
84 <!-- The dashboard Settings row (ia.homepage + summary). -->
85 <activity-alias
86 android:name=".ui.DashboardActivity"
87 android:exported="true"
88 android:label="@string/app_name"
89 android:targetActivity=".MainActivity">
90 <intent-filter>
91 <action android:name="com.vayunmathur.screentime.action.DASHBOARD" />
92 <category android:name="android.intent.category.DEFAULT" />
93 </intent-filter>
94 <meta-data
95 android:name="com.android.settings.category"
96 android:value="com.android.settings.category.ia.homepage" />
97 <meta-data
98 android:name="com.android.settings.summary"
99 android:resource="@string/dashboard_summary" />
100 </activity-alias>
101
102 <!-- The Wind Down Settings row, answering the platform bedtime action. -->
103 <activity-alias
104 android:name=".ui.WindDownActivity"
105 android:exported="true"
106 android:label="@string/winddown_title"
107 android:targetActivity=".MainActivity">
108 <intent-filter>
109 <action android:name="android.settings.BEDTIME_SETTINGS" />
110 <category android:name="android.intent.category.DEFAULT" />
111 </intent-filter>
112 <meta-data
113 android:name="com.android.settings.category"
114 android:value="com.android.settings.category.ia.homepage" />
115 <meta-data
116 android:name="com.android.settings.summary"
117 android:resource="@string/winddown_summary" />
118 </activity-alias>
119
120 <!-- Per-app details: our own action, plus the suspended-app details action
121 the platform's paused treatment resolves (package in the data URI). -->
122 <activity-alias
123 android:name=".ui.AppDetailsActivity"
124 android:exported="true"
125 android:label="@string/details_title"
126 android:targetActivity=".MainActivity">
127 <intent-filter>
128 <action android:name="com.vayunmathur.screentime.action.APP_DETAILS" />
129 <category android:name="android.intent.category.DEFAULT" />
130 </intent-filter>
131 <intent-filter>
132 <action android:name="android.intent.action.SHOW_SUSPENDED_APP_DETAILS" />
133 <category android:name="android.intent.category.DEFAULT" />
134 <data android:scheme="package" />
135 </intent-filter>
136 </activity-alias>
137
138 <!--
139 Friction sheets and the expired-timer notice. Started explicitly by our own
140 receivers and the usage-observer path; never exported, never in the launcher.
141 showWhenLocked is set in code so the sheet meets the launch, not the home screen.
142 -->
143 <activity
144 android:name=".ui.FrictionActivity"
145 android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
146 android:excludeFromRecents="true"
147 android:exported="false"
148 android:launchMode="singleInstance"
149 android:theme="@style/Theme.General" />
150
151 <!-- Fired by UsageStatsService when an app spends its timer budget. -->
152 <receiver
153 android:name=".platform.TimerReachedReceiver"
154 android:exported="false" />
155
156 <!-- Wind-down window edges. Re-armed each time one fires. -->
157 <receiver
158 android:name=".platform.ScheduleReceiver"
159 android:exported="false" />
160
161 <!-- Time/timezone changes move midnight and wind-down boundaries. -->
162 <receiver
163 android:name=".platform.TimeChangedReceiver"
164 android:exported="false">
165 <intent-filter>
166 <action android:name="android.intent.action.TIME_SET" />
167 <action android:name="android.intent.action.TIMEZONE_CHANGED" />
168 <action android:name="android.intent.action.DATE_CHANGED" />
169 </intent-filter>
170 </receiver>
171
172 <receiver
173 android:name=".platform.BootReceiver"
174 android:exported="true">
175 <intent-filter>
176 <action android:name="android.intent.action.BOOT_COMPLETED" />
177 <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
178 </intent-filter>
179 </receiver>
180
181 <!-- Assistant usage summary: aggregates only (today's total + top apps). -->
182 <activity
183 android:name=".intents.GetUsageIntent"
184 android:exported="true"
185 android:permission="com.vayunmathur.screentime.permissions.ACCESS_SCREENTIME"
186 android:theme="@android:style/Theme.NoDisplay" />
187
188 <receiver
189 android:name=".widget.ScreenTimeGlanceWidgetReceiver"
190 android:exported="false"
191 android:label="@string/widget_description">
192 <intent-filter>
193 <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
194 </intent-filter>
195 <meta-data
196 android:name="android.appwidget.provider"
197 android:resource="@xml/screentime_widget_info" />
198 </receiver>
199 </application>
200</manifest>