Modern Apps git

MAOS.git

Public
git clone https://git.maproj.org/MAOS.git
main ▾

MAOS.git / rro / MaosFrameworkResRRO / res / values / config.xml

config.xml246 lines · 17.2 KiBRaw
1<?xml version="1.0" encoding="utf-8"?>
2<!-- MAOS framework-res overrides, shipped as an explicit static, platform-signed RRO
3 (module MaosFrameworkResRRO). Moved here from the former
4 overlay/frameworks/base/core/res/res/values/config.xml so PRODUCT_PACKAGE_OVERLAYS no
5 longer generates an auto-generated framework-res RRO that collides with adevtool's prebuilt.
6 framework-res.apk itself stays unmodified. -->
7<resources>
8 <!-- Default browser role -> Modern Apps Web.
9 Vanadium remains installed as the system WebView provider; this only changes
10 which app holds the browser role. -->
11 <string name="config_defaultBrowser" translatable="false">com.vayunmathur.web</string>
12
13 <!-- Storage Access Framework / documents UI host -> Modern Apps Files.
14 Replaces com.android.documentsui. The Files app must ship a system build variant
15 that registers the SAF picker intents and holds MANAGE_DOCUMENTS (allowlisted in
16 privapp-permissions-modern-apps.xml). -->
17 <string name="config_documentsUiPackage" translatable="false">com.vayunmathur.files</string>
18
19 <!-- Default speech recognition (STT) -> Modern Apps Speech (Whisper, on-device).
20 AOSP ships no default recognizer; this makes SpeechRecognizer work offline. -->
21 <string name="config_defaultSpeechRecognitionService" translatable="false">com.vayunmathur.speech/.service.WhisperRecognitionService</string>
22 <string name="config_defaultOnDeviceSpeechRecognitionService" translatable="false">com.vayunmathur.speech/.service.WhisperRecognitionService</string>
23 <!-- TTS: Modern Apps Speech (Piper) is the only installed engine, so the framework
24 selects it as the default TTS engine automatically; no dedicated config exists. -->
25
26 <!-- Default dialer role -> Modern Apps Communicate. Replaces GrapheneOS's Dialer
27 (com.android.dialer), removed in modern_apps.mk. Communicate declares an InCallService
28 and holds the DIALER role. -->
29 <string name="config_defaultDialer" translatable="false">com.vayunmathur.communicate</string>
30
31 <!-- Default SMS/MMS app role -> Modern Apps Communicate. Replaces GrapheneOS's Messaging
32 (com.android.messaging), removed in modern_apps.mk. Communicate declares the
33 SMS_DELIVER / WAP_PUSH_DELIVER receivers and holds the SMS role; the role system
34 auto-grants its SMS/Phone/Contacts runtime permissions. -->
35 <string name="config_defaultSms" translatable="false">com.vayunmathur.communicate</string>
36
37 <!-- Offline geocoder -> Modern Apps NetworkLocation. Its GeocodeService (bound via the
38 com.android.location.service.GeocodeProvider action) becomes THE system geocoder.
39 Replaces GrapheneOS's NetworkLocation module (removed in modern_apps.mk). -->
40 <string name="config_geocoderProviderPackageName" translatable="false">com.vayunmathur.networklocation</string>
41
42 <!-- Network location provider -> Modern Apps NetworkLocation. Its NetworkLocationService
43 (bound via the com.android.location.service.v3.NetworkLocationProvider action) becomes
44 THE system network location provider, replacing GrapheneOS's NetworkLocation module. -->
45 <string name="config_networkLocationProviderPackageName" translatable="false">com.vayunmathur.networklocation</string>
46
47 <!-- The two config_*ProviderPackageName pins above are ONLY honored when these overlay
48 bools are false. They default to TRUE in AOSP, in which case the framework ignores the
49 explicit package name and instead signature-matches candidate providers against the
50 platform key (picking the highest version). Our app is presigned with the com.vayunmathur
51 key, not the platform key, so it would never be selected. Force the explicit-pin path. -->
52 <bool name="config_enableNetworkLocationOverlay">false</bool>
53 <bool name="config_enableGeocoderOverlay">false</bool>
54
55 <!-- Time zone detection: NITZ (telephony) OFF, offline location provider ON.
56 The GeoTZ module's OfflineLocationTimeZoneProviderService (package
57 com.android.timezone.location.provider, bound via the
58 PrimaryLocationTimeZoneProviderService action) works from an offline DB with no
59 network, so it is the correct primary provider for MAOS. Telephony detection and
60 the geolocation->telephony fallback are both disabled so a stale/missing NITZ
61 signal can never override the location result. Secondary provider stays off. -->
62 <bool name="config_enableTelephonyTimeZoneDetection">false</bool>
63 <bool name="config_supportTelephonyTimeZoneFallback">false</bool>
64 <bool name="config_enableGeolocationTimeZoneDetection" translatable="false">true</bool>
65 <bool name="config_enablePrimaryLocationTimeZoneProvider" translatable="false">true</bool>
66 <string name="config_primaryLocationTimeZoneProviderPackageName" translatable="false">com.android.timezone.location.provider</string>
67 <bool name="config_enableSecondaryLocationTimeZoneProvider" translatable="false">false</bool>
68 <string name="config_secondaryLocationTimeZoneProviderPackageName" translatable="false"></string>
69
70 <!-- NTP server list: emptied. The framework's NtpTrustedTime hardcodes HTTPS mode at
71 runtime and never consults this array for time sync; only its dump() path reads it
72 (via getNtpConfigInternal, which iterates the array and tolerates empty). The stock
73 entry (ntp://time.android.com) is therefore inert, so drop the string rather than
74 ship a dead reference to a Google time server. -->
75 <string-array translatable="false" name="config_ntpServers"></string-array>
76
77 <!-- HTTPS time detection: self-hosted endpoint. Replaces GrapheneOS's
78 https://time.grapheneos.org/generate_204 (the framework default in
79 config_httpsTimeUrls). The same URL doubles as the connectivity-check
80 endpoint — Android does not require time and connectivity checks to
81 use separate URLs. -->
82 <string-array translatable="false" name="config_httpsTimeUrls">
83 <item>https://maproj.org/generate_204</item>
84 </string-array>
85
86 <!-- Default app-data backup transport -> Modern Apps Backup. Replaces GrapheneOS's
87 Seedvault (com.stevesoltys.seedvault) and the GrapheneOS contacts backup transport
88 (app.grapheneos.backup.contacts), both removed in modern_apps.mk. This is the AOSP
89 framework default-transport pin (a "package/service" component); Backup holds the
90 signature|privileged BACKUP permission (allowlisted in
91 privapp-permissions-modern-apps.xml) so the BackupManagerService will bind it. -->
92
93 <string name="config_backup_transport" translatable="false">com.vayunmathur.backup/.service.ConfigurableBackupTransportService</string>
94
95 <!-- System gallery role -> Modern Apps Photos. AOSP's default names com.android.gallery3d,
96 which MAOS does not ship, so this role was simply unheld.
97
98 The visible payoff is the two app-ops the role sets to allowed,
99 android:write_media_images and android:write_media_video: those are what let a gallery
100 edit and delete media WITHOUT a per-file consent dialog. The role also grants
101 READ_MEDIA_AUDIO and START_FOREGROUND_SERVICES_FROM_BACKGROUND, and
102 SystemGalleryRoleBehavior grants the photo/video permissions and ACCESS_MEDIA_LOCATION
103 in code, overriding the user's choice, which the write_media app-ops override
104 anyway. -->
105 <!-- Automotive projection role -> Modern Apps Cast.
106
107 This is the ONLY route by which cast can hold ADD_TRUSTED_DISPLAY, which is
108 `signature|role`. Privileged placement cannot grant it - that covers
109 `signature|privileged` only - and cast is presigned with the com.vayunmathur key, so the
110 `signature` half never matches. SYSTEM_AUTOMOTIVE_PROJECTION is the role carrying it
111 (roles.xml, minSdkVersion 34). Without this pin `createVirtualDisplay` throws
112 SecurityException and cast is stuck on MediaProjection screen capture: a consent prompt
113 every session, and no system mirror/extend switch.
114
115 WHAT THIS COSTS, stated plainly because it is not free and must not read as if it were.
116 `Role.grantAsUser` (role-controller/.../model/Role.java:945-950) calls
117 `Permissions.grantAsUser` over the role's WHOLE permission list, so holding the role
118 AUTO-GRANTS cast roughly 25 permissions: the microphone, location, nearby-devices and
119 notification sets, plus SEND_SMS, RECEIVE_SMS, READ_CONTACTS, READ_CALL_LOG,
120 READ_CALENDAR, CALL_PHONE, READ_PHONE_STATE, CREATE_VIRTUAL_DEVICE,
121 RECEIVE_SENSITIVE_NOTIFICATIONS and CAPTURE_SECURE_VIDEO_OUTPUT. Not "made grantable" -
122 granted. This was weighed against platform-signing the app and chosen deliberately.
123
124 The role name is not a borrowed one: MA Auto IS the automotive projection
125 sender, so this is its role outright. MA Cast previously held this pin solely
126 for ADD_TRUSTED_DISPLAY; it now holds COMPANION_DEVICE_APP_STREAMING
127 (non-exclusive, same `virtual_device` set), so the exclusive automotive role
128 is free for Auto.
129
130 exclusive="true", so nothing else in MAOS may hold it. systemOnly="true" is satisfied
131 because auto is preinstalled as a privileged prebuilt (ModernAppsAuto).
132 config_systemAutomotiveProjection ships EMPTY in AOSP, so there is no existing
133 holder to displace.
134
135 Precedent: config_defaultSms above works the same way - the SMS role auto-grants its
136 SMS/Phone/Contacts runtime permissions. -->
137 <string name="config_systemAutomotiveProjection" translatable="false">com.vayunmathur.auto</string>
138
139 <!-- Companion-device app-streaming role -> Modern Apps Cast.
140
141 Cast previously held SYSTEM_AUTOMOTIVE_PROJECTION solely for ADD_TRUSTED_DISPLAY
142 (see above). COMPANION_DEVICE_APP_STREAMING carries the same `virtual_device` set
143 plus notifications, RECORD_AUDIO and (on 36+) the sensitive-notification app-op,
144 and is exclusive="false", so Cast keeps its trusted virtual display without
145 blocking Auto from the automotive role. The role has no `defaultHolders` in AOSP;
146 it is pinned here and the defaultHolders attribute is added by
147 patches/permission_roles.patch (packages/modules/Permission). -->
148 <string name="config_companionDeviceAppStreaming" translatable="false">com.vayunmathur.cast</string>
149
150 <!-- Supervision (parental controls) role -> Modern Apps Parental Controls.
151
152 This pin is the ONLY reason Settings > Parental controls exists on MAOS. The framework
153 (android.app.supervision, SupervisionService) and the entire Settings UI
154 (com/android/settings/supervision: dashboard, PIN and recovery, bedtime schedules, app
155 limits, web content filters, app store filters) already ship in this tree, and the
156 gating flag android.app.supervision.flags.enable_supervision_settings_screen is on.
157 What was missing is the role holder. config_systemSupervision ships EMPTY in AOSP and
158 Google fills it with a GMS component; with nothing answering the supervision messenger
159 bind action, SupervisionHelper.hasNecessarySupervisionComponent fails and
160 TopLevelSupervisionPreferenceController reports UNSUPPORTED_ON_DEVICE, hiding the entry
161 outright. That is why parental controls looked removed rather than merely switched off.
162
163 WHAT THIS COSTS, stated plainly. SYSTEM_SUPERVISION is static, exclusive, systemOnly
164 and visible="false", and holding it AUTO-GRANTS a large set: ACCESS_INSTANT_APPS,
165 KILL_UID, MANAGE_APP_OPS_MODES, MANAGE_DEFAULT_APPLICATIONS, SUSPEND_APPS,
166 SYSTEM_APPLICATION_OVERLAY, MANAGE_PROFILE_AND_DEVICE_OWNERS, MANAGE_SUPERVISION and
167 roughly twenty MANAGE_DEVICE_POLICY_* permissions (apps control, lock and lock
168 credentials, keyguard, factory reset, location, camera, runtime permissions, safe boot,
169 time, users, package state, debugging features and more). That breadth is inherent to
170 what a supervision app IS, since it is the app a parent uses to suspend apps and lock a
171 device, but it is a role grant rather than a permission the user was asked about, so it
172 is recorded here at the pin.
173
174 Parental Controls declares no permissions of its own and has no launcher icon: it exists to
175 answer the bind and to forward the install-app action to Settings' own enable flow.
176 systemOnly="true" is satisfied by being preinstalled under /product. It is deliberately
177 NOT in privapp-permissions-modern-apps.xml, since these are signature|role rather than
178 signature|privileged and a mismatched entry there is boot-fatal. -->
179 <string name="config_systemSupervision" translatable="false">com.vayunmathur.parentalcontrols</string>
180
181 <!-- System wellbeing app -> Modern Apps Screen Time. Upstream defaults to empty, in
182 which case Settings shows no Digital Wellbeing entry and no role holder exists to
183 grant SUSPEND_APPS / SYSTEM_APPLICATION_OVERLAY / OBSERVE_APP_USAGE. The pin is the
184 default holder of the SYSTEM_WELLBEING role (see roles.xml defaultHolders). No
185 privapp-permissions entry: not a priv-app. -->
186 <string name="config_systemWellbeing" translatable="false">com.vayunmathur.screentime</string>
187
188 <string name="config_systemGallery" translatable="false">com.vayunmathur.photos</string>
189
190 <!-- System speech recognizer role -> Modern Apps Speech.
191
192 This is a DIFFERENT MECHANISM from config_defaultSpeechRecognitionService above and the
193 two are easy to confuse. That one names the service the framework binds; this one makes
194 Speech hold the role, which is what grants the role's permissions. Both are needed.
195
196 config_systemSpeechRecognizer ships empty in AOSP. The role grants RECORD_AUDIO and
197 UPDATE_APP_OPS_STATS, so the recognizer holds the microphone without a prompt.
198 Qualification needs a service answering android.speech.RecognitionService, which
199 Speech's WhisperRecognitionService already declares. This is a second route to
200 RECORD_AUDIO alongside the fixed="false" grant in default-permissions-modern-apps.xml.
201 The two are harmless together, and that entry is deliberately kept: a role that fails
202 to qualify does so silently, and the default-permissions grant is what keeps voice
203 input working if that ever happens. -->
204 <string name="config_systemSpeechRecognizer" translatable="false">com.vayunmathur.speech</string>
205
206 <!-- System contacts role -> Modern Apps Contacts. AOSP's default names
207 com.android.contacts, which MAOS does not ship, so this role was unheld. It grants
208 ACCESS_RCS_USER_CAPABILITY_EXCHANGE and SET_DEFAULT_ACCOUNT_FOR_CONTACTS. -->
209 <string name="config_systemContacts" translatable="false">com.vayunmathur.contacts</string>
210
211 <!-- External-display resolution picker: stop filtering out modes that are not 60 Hz.
212
213 Settings' ResolutionPreferenceFragment.isAllowedMode drops every mode outside
214 60 +/- 1 Hz when this is true, keeping only the one already in use. That filter exists
215 to hold a physically-connected panel in sync with the internal display; a MA Cast
216 virtual display is not driven by the same clock and has nothing to synchronise with,
217 so the rule only removes real choices. With it on, a cast desktop offering
218 3840x2160, 1920x1080 and 1280x720 showed a single entry as soon as any of them
219 settled below 60 - which a 4K mode does whenever the phone's encoder cannot sustain
220 60 fps at that size.
221
222 AOSP's own default is false (core/res/res/values/config.xml); it is the Pixel device
223 overlay that turns it on, and this puts it back. -->
224 <bool name="config_refreshRateSynchronizationEnabled">false</bool>
225
226 <!-- External displays: no artificial size or refresh ceiling.
227
228 The Pixel product overlay caps external displays at 3440x1600 at 61 Hz - an ultrawide
229 monitor, which is a sensible bound for what the phone drives over DisplayPort and a
230 meaningless one for a display that exists only as a surface handed to an encoder. The
231 cap is enforced twice: DisplayModeDirector.DisplayObserver votes against modes above
232 it, and Settings' resolution picker filters them out of the list.
233
234 The symptom was that a 4K cast desktop offered exactly one 4K entry. Every 3840x2160
235 mode was rejected with "height is above the allowed limit", and the survivor was only
236 there because the picker always re-adds the display's active mode. 1920x1080 and
237 1280x720 fit under the cap, which is why they alone listed all their rates.
238
239 Zero on all three is AOSP's own default (core/res/res/values/config.xml) and disables
240 the limit entirely - DisplayObserver.isExternalDisplayLimitModeEnabled requires all
241 three to be positive. The trade is that a genuinely-attached monitor is no longer held
242 to what the phone's DisplayPort output was tuned for either. -->
243 <integer name="config_externalDisplayPeakWidth">0</integer>
244 <integer name="config_externalDisplayPeakHeight">0</integer>
245 <integer name="config_externalDisplayPeakRefreshRate">0</integer>
246</resources>