Modern Apps git

MAOS.git

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

MAOS.git / patches / settings.patch

settings.patch854 lines · 46.4 KiBRaw
1diff --git a/AndroidManifest.xml b/AndroidManifest.xml
2index d4e5e0e8670..e65049446df 100644
3--- a/AndroidManifest.xml
4+++ b/AndroidManifest.xml
5@@ -150,10 +150,13 @@
6 <uses-permission android:name="android.permission.SATELLITE_COMMUNICATION" />
7 <uses-permission android:name="android.permission.READ_SYSTEM_GRAMMATICAL_GENDER" />
8 <uses-permission android:name="android.permission.MANAGE_COMPANION_DEVICES" />
9- <uses-permission android:name="app.grapheneos.logviewer.SHOW_LOGCAT" />
10+ <uses-permission android:name="com.vayunmathur.logviewer.SHOW_LOGCAT" />
11 <uses-permission android:name="android.permission.CONTROL_SIM_AUTO_PIN_MANAGEMENT" />
12 <uses-permission android:name="android.permission.MANAGE_COMPUTER_CONTROL_CONSENT" />
13
14+ <!-- MAOS: opt out of the GrapheneOS Sensors permission (never requested nor granted). -->
15+ <uses-permission android:name="com.vayunmathur.permission.SENSORS_OPTOUT" />
16+
17 <application
18 android:name=".SettingsApplication"
19 android:label="@string/settings_label"
20diff --git a/res/values-en-rAU/strings.xml b/res/values-en-rAU/strings.xml
21index c181c5bc2b2..225af58eee0 100644
22--- a/res/values-en-rAU/strings.xml
23+++ b/res/values-en-rAU/strings.xml
24@@ -973,7 +973,7 @@
25 <string name="external_display_topology_a11y_display_moved_down" msgid="6028544722984648702">"Display: %1$s moved down"</string>
26 <string name="external_display_topology_a11y_display_moved_left" msgid="5308110789317472437">"Display: %1$s moved left"</string>
27 <string name="external_display_topology_a11y_display_moved_right" msgid="3802527156765844475">"Display: %1$s moved right"</string>
28- <string name="wifi_display_settings_title" msgid="2622548133505158832">"Google Cast"</string>
29+ <string name="wifi_display_settings_title" msgid="2622548133505158832">"Cast"</string>
30 <string name="keywords_wifi_display_settings" msgid="5753883229564422679">"mirror"</string>
31 <string name="wifi_display_enable_menu_item" msgid="7391841780777318134">"Enable wireless display"</string>
32 <string name="wifi_display_no_devices_found" msgid="7904877793677102805">"No nearby devices were found."</string>
33@@ -3775,7 +3775,7 @@
34 <string name="keywords_text_cursor_blink_rate" msgid="7682963763334011148">"caret, text caret, text cursor, cursor, blinking, blink interval, blink rate, animation, reduce animation, remove animation"</string>
35 <string name="sound_dashboard_summary" msgid="8254699132423665654">"Volume and vibration"</string>
36 <string name="media_volume_option_title" msgid="5966569685119475630">"Media volume"</string>
37- <string name="remote_media_volume_option_title" msgid="7907330631195715350">"Google Cast volume"</string>
38+ <string name="remote_media_volume_option_title" msgid="7907330631195715350">"Cast volume"</string>
39 <string name="call_volume_option_title" msgid="1461105986437268924">"Call volume"</string>
40 <string name="alarm_volume_option_title" msgid="6398641749273697140">"Alarm volume"</string>
41 <string name="assistant_volume_option_title" msgid="7206008753384831048">"Assistant volume"</string>
42diff --git a/res/values-en-rCA/strings.xml b/res/values-en-rCA/strings.xml
43index 22b6f74c23f..0fa0efba534 100644
44--- a/res/values-en-rCA/strings.xml
45+++ b/res/values-en-rCA/strings.xml
46@@ -973,7 +973,7 @@
47 <string name="external_display_topology_a11y_display_moved_down" msgid="6028544722984648702">"Display: %1$s moved down"</string>
48 <string name="external_display_topology_a11y_display_moved_left" msgid="5308110789317472437">"Display: %1$s moved left"</string>
49 <string name="external_display_topology_a11y_display_moved_right" msgid="3802527156765844475">"Display: %1$s moved right"</string>
50- <string name="wifi_display_settings_title" msgid="2622548133505158832">"Google Cast"</string>
51+ <string name="wifi_display_settings_title" msgid="2622548133505158832">"Cast"</string>
52 <string name="keywords_wifi_display_settings" msgid="5753883229564422679">"mirror"</string>
53 <string name="wifi_display_enable_menu_item" msgid="7391841780777318134">"Enable wireless display"</string>
54 <string name="wifi_display_no_devices_found" msgid="7904877793677102805">"No nearby devices were found."</string>
55@@ -3775,7 +3775,7 @@
56 <string name="keywords_text_cursor_blink_rate" msgid="7682963763334011148">"caret, text caret, text cursor, cursor, blinking, blink interval, blink rate, animation, reduce animation, remove animation"</string>
57 <string name="sound_dashboard_summary" msgid="8254699132423665654">"Volume and vibration"</string>
58 <string name="media_volume_option_title" msgid="5966569685119475630">"Media volume"</string>
59- <string name="remote_media_volume_option_title" msgid="7907330631195715350">"Google Cast volume"</string>
60+ <string name="remote_media_volume_option_title" msgid="7907330631195715350">"Cast volume"</string>
61 <string name="call_volume_option_title" msgid="1461105986437268924">"Call volume"</string>
62 <string name="alarm_volume_option_title" msgid="6398641749273697140">"Alarm volume"</string>
63 <string name="assistant_volume_option_title" msgid="7206008753384831048">"Assistant volume"</string>
64diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml
65index ffe06a45ad7..3612e93b96b 100644
66--- a/res/values-en-rGB/strings.xml
67+++ b/res/values-en-rGB/strings.xml
68@@ -973,7 +973,7 @@
69 <string name="external_display_topology_a11y_display_moved_down" msgid="6028544722984648702">"Display: %1$s moved down"</string>
70 <string name="external_display_topology_a11y_display_moved_left" msgid="5308110789317472437">"Display: %1$s moved left"</string>
71 <string name="external_display_topology_a11y_display_moved_right" msgid="3802527156765844475">"Display: %1$s moved right"</string>
72- <string name="wifi_display_settings_title" msgid="2622548133505158832">"Google Cast"</string>
73+ <string name="wifi_display_settings_title" msgid="2622548133505158832">"Cast"</string>
74 <string name="keywords_wifi_display_settings" msgid="5753883229564422679">"mirror"</string>
75 <string name="wifi_display_enable_menu_item" msgid="7391841780777318134">"Enable wireless display"</string>
76 <string name="wifi_display_no_devices_found" msgid="7904877793677102805">"No nearby devices were found."</string>
77@@ -3775,7 +3775,7 @@
78 <string name="keywords_text_cursor_blink_rate" msgid="7682963763334011148">"caret, text caret, text cursor, cursor, blinking, blink interval, blink rate, animation, reduce animation, remove animation"</string>
79 <string name="sound_dashboard_summary" msgid="8254699132423665654">"Volume and vibration"</string>
80 <string name="media_volume_option_title" msgid="5966569685119475630">"Media volume"</string>
81- <string name="remote_media_volume_option_title" msgid="7907330631195715350">"Google Cast volume"</string>
82+ <string name="remote_media_volume_option_title" msgid="7907330631195715350">"Cast volume"</string>
83 <string name="call_volume_option_title" msgid="1461105986437268924">"Call volume"</string>
84 <string name="alarm_volume_option_title" msgid="6398641749273697140">"Alarm volume"</string>
85 <string name="assistant_volume_option_title" msgid="7206008753384831048">"Assistant volume"</string>
86diff --git a/res/values-en-rIN/strings.xml b/res/values-en-rIN/strings.xml
87index 28a57a30e88..5ab0ed5d081 100644
88--- a/res/values-en-rIN/strings.xml
89+++ b/res/values-en-rIN/strings.xml
90@@ -973,7 +973,7 @@
91 <string name="external_display_topology_a11y_display_moved_down" msgid="6028544722984648702">"Display: %1$s moved down"</string>
92 <string name="external_display_topology_a11y_display_moved_left" msgid="5308110789317472437">"Display: %1$s moved left"</string>
93 <string name="external_display_topology_a11y_display_moved_right" msgid="3802527156765844475">"Display: %1$s moved right"</string>
94- <string name="wifi_display_settings_title" msgid="2622548133505158832">"Google Cast"</string>
95+ <string name="wifi_display_settings_title" msgid="2622548133505158832">"Cast"</string>
96 <string name="keywords_wifi_display_settings" msgid="5753883229564422679">"mirror"</string>
97 <string name="wifi_display_enable_menu_item" msgid="7391841780777318134">"Enable wireless display"</string>
98 <string name="wifi_display_no_devices_found" msgid="7904877793677102805">"No nearby devices were found."</string>
99@@ -3775,7 +3775,7 @@
100 <string name="keywords_text_cursor_blink_rate" msgid="7682963763334011148">"caret, text caret, text cursor, cursor, blinking, blink interval, blink rate, animation, reduce animation, remove animation"</string>
101 <string name="sound_dashboard_summary" msgid="8254699132423665654">"Volume and vibration"</string>
102 <string name="media_volume_option_title" msgid="5966569685119475630">"Media volume"</string>
103- <string name="remote_media_volume_option_title" msgid="7907330631195715350">"Google Cast volume"</string>
104+ <string name="remote_media_volume_option_title" msgid="7907330631195715350">"Cast volume"</string>
105 <string name="call_volume_option_title" msgid="1461105986437268924">"Call volume"</string>
106 <string name="alarm_volume_option_title" msgid="6398641749273697140">"Alarm volume"</string>
107 <string name="assistant_volume_option_title" msgid="7206008753384831048">"Assistant volume"</string>
108diff --git a/res/values/strings.xml b/res/values/strings.xml
109index 55de29a749a..9041d8a83e3 100644
110--- a/res/values/strings.xml
111+++ b/res/values/strings.xml
112@@ -2283,7 +2283,7 @@
113 <string name="external_display_topology_a11y_display_moved_right">Display: %1$s moved right</string>
114
115 <!-- Wifi Display settings. The title of the screen. [CHAR LIMIT=40] -->
116- <string name="wifi_display_settings_title">Google Cast</string>
117+ <string name="wifi_display_settings_title">Cast</string>
118 <!-- Wifi Display settings. The keywords of the setting. [CHAR LIMIT=NONE] -->
119 <string name="keywords_wifi_display_settings">mirror</string>
120 <!-- Wifi Display settings. The title of a menu item to enable wireless display [CHAR LIMIT=40] -->
121@@ -9040,7 +9040,7 @@
122 <string name="media_volume_option_title">Media volume</string>
123
124 <!-- Sound: Title for the option managing remote media volume. [CHAR LIMIT=30] -->
125- <string name="remote_media_volume_option_title">Google Cast volume</string>
126+ <string name="remote_media_volume_option_title">Cast volume</string>
127
128 <!-- Sound: Title for the option managing call volume. [CHAR LIMIT=30] -->
129 <string name="call_volume_option_title">Call volume</string>
130diff --git a/res/values/strings_app_exploit_protection.xml b/res/values/strings_app_exploit_protection.xml
131index 59348a1fc82..42111bf22a0 100644
132--- a/res/values/strings_app_exploit_protection.xml
133+++ b/res/values/strings_app_exploit_protection.xml
134@@ -34,7 +34,7 @@ This behavior can be disabled in the %2$s section.</string>
135 <string name="aep_ir_exploit_protection_compat_mode">%1$s is enabled</string>
136
137 <string name="aep_compat_mode_title">Exploit protection compatibility mode</string>
138- <string name="aep_compat_mode_summary">Improves compatibility by disabling some of the GrapheneOS exploit protections for this app</string>
139+ <string name="aep_compat_mode_summary">Improves compatibility by disabling some of the Modern Apps OS exploit protections for this app</string>
140
141 <string name="aep_hmalloc">Hardened memory allocator</string>
142 <string name="aep_hmalloc_footer">
143diff --git a/res/values/strings_ext.xml b/res/values/strings_ext.xml
144index 18de9b0a68d..2802c605ed4 100644
145--- a/res/values/strings_ext.xml
146+++ b/res/values/strings_ext.xml
147@@ -52,26 +52,6 @@
148 <string name="supl_disabled">Off</string>
149 <string name="supl_disabled_summary">Will make acquiring location lock significantly slower, especially if PSDS is turned off too</string>
150
151- <string name="g_euicc_lpa_title">eSIM support</string>
152- <string name="g_euicc_lpa_enable_dialog_msg">
153-A device restart is required to enable this setting.
154- </string>
155- <string name="g_euicc_lpa_disable_dialog_title">Warning</string>
156- <string name="g_euicc_lpa_disable_dialog_msg">
157-"Turning off eSIM support will break the following functionality:
158-
159-• adding new eSIMs
160-• turning existing eSIMs on or off
161-• removing eSIMs, including from the lock screen (e.g. when eSIM is locked with a forgotten PIN)
162-• wiping eSIMs during factory reset
163-
164-Device will be automatically restarted."
165- </string>
166- <string name="g_euicc_lpa_restart_button">Restart</string>
167- <string name="g_euicc_lpa_proceed_button">Proceed</string>
168- <string name="sim_action_esim_support_disabled_title">Can\'t turn off eSIM</string>
169- <string name="sim_action_esim_support_disabled_text">eSIM support is turned off. Enable eSIM support to disable the eSIM.</string>
170-
171 <string name="remote_provisioning_title">Attestation key provisioning</string>
172 <string name="remote_provisioning_enabled_grapheneos_proxy">GrapheneOS proxy</string>
173 <string name="remote_provisioning_enabled_google_server">Google server</string>
174@@ -196,7 +176,7 @@ There are HTTP, HTTPS, DNS, DNS-over-TLS and DNS-over-HTTPS connectivity checks.
175 <string name="duress_pwd_pref_title">Duress password</string>
176 <string name="duress_pwd_description">"Duress password can be entered instead of the user password in any place that asks for it, such as the lock screen of any user and any user or work profile password prompt.
177
178-Submitting the duress password will immediately make the storage contents permanently inaccessible, delete all eSIMs and then power off the device. GrapheneOS will remain installed.
179+Submitting the duress password will immediately make the storage contents permanently inaccessible, delete all eSIMs and then power off the device. Modern Apps OS will remain installed.
180
181 Duress PIN works the same way duress password does."</string>
182 <string name="duress_pwd_enter_pin">Enter duress PIN</string>
183@@ -226,7 +206,7 @@ Duress PIN works the same way duress password does."</string>
184 <string name="alt_touchscreen_mode_confirm_button">Confirm</string>
185
186 <string name="app_play_integrity_api">Play Integrity API</string>
187- <string name="app_play_integrity_top_intro">The Play Integrity API allows services to verify properties of a device through their app. Most services check for the device or strong integrity level which requires having the unmodified stock OS on a device licensing Google Mobile Services. Not every app using it will ban using GrapheneOS. GrapheneOS passes the basic integrity level and the miscellaneous checks for licensing, Play Protect, etc. work fine. We recommend leaving feedback for apps using it to ban GrapheneOS asking them to stop banning using a much more secure OS. Apps can use the standard Android hardware attestation API to verify the hardware, OS and app with GrapheneOS.</string>
188+ <string name="app_play_integrity_top_intro">The Play Integrity API allows services to verify properties of a device through their app. Most services check for the device or strong integrity level which requires having the unmodified stock OS on a device licensing Google Mobile Services. Not every app using it will ban using Modern Apps OS. Modern Apps OS passes the basic integrity level and the miscellaneous checks for licensing, Play Protect, etc. work fine. We recommend leaving feedback for apps using it to ban Modern Apps OS asking them to stop banning using a much more secure OS. Apps can use the standard Android hardware attestation API to verify the hardware, OS and app with Modern Apps OS.</string>
189 <string name="app_play_integrity_contact_app_developer">Contact app developer</string>
190 <string name="app_play_integrity_show_usage_notifications">Show usage notifications</string>
191 <string name="app_play_integrity_block_usage_attempts">Block usage attempts</string>
192@@ -238,6 +218,13 @@ Duress PIN works the same way duress password does."</string>
193 <string name="app_play_integrity_see_all_apps">Show apps that used the Play Integrity API</string>
194
195 <string name="network_location_title">Network location</string>
196+ <!-- Location services row covering both network location and geocoding, which Modern
197+ Apps OS serves from one always-on provider rather than two server pickers. -->
198+ <string name="network_location_geocoding_title">Network location &amp; geocoding</string>
199+ <!-- Summary of the row above, when the offline databases have been downloaded. -->
200+ <string name="network_location_geocoding_ready">Works offline</string>
201+ <!-- Summary of the row above, when the offline databases have not been downloaded. -->
202+ <string name="network_location_geocoding_setup_required">Setup required</string>
203 <string name="network_location_footer">
204 "Network location is a method of determining your device’s location by using various nearby signals, such as Wi-Fi networks, Bluetooth devices, and cell towers. Your device scans for these signals and sends their identifiers to a server, which then provides positioning data that your device uses to estimate its location. Currently, Wi-Fi networks and cell towers are used.
205
206diff --git a/res/xml/location_services.xml b/res/xml/location_services.xml
207index e33f3a5eace..32d14f99642 100644
208--- a/res/xml/location_services.xml
209+++ b/res/xml/location_services.xml
210@@ -37,13 +37,7 @@
211 <com.android.settingslib.RestrictedPreference
212 android:order="1002"
213 android:key="location_services_network_location"
214- android:title="@string/network_location_title"
215+ android:title="@string/network_location_geocoding_title"
216 settings:controller="com.android.settings.location.LocationServicesNetworkLocationPreferenceController"/>
217
218- <com.android.settingslib.RestrictedPreference
219- android:key="location_services_geocoder"
220- android:order="1003"
221- android:title="@string/geocoder_title"
222- settings:controller="com.android.settings.location.LocationServicesGeocoderPreferenceController" />
223-
224 </PreferenceScreen>
225diff --git a/res/xml/network_provider_internet.xml b/res/xml/network_provider_internet.xml
226index 0ed7956c448..c62308062f3 100644
227--- a/res/xml/network_provider_internet.xml
228+++ b/res/xml/network_provider_internet.xml
229@@ -56,14 +56,6 @@
230 settings:useAdminDisabledSummary="true"
231 settings:controller="com.android.settings.network.MobileNetworkSummaryController" />
232
233- <com.android.settingslib.RestrictedSwitchPreference
234- android:key="google_euicc_lpa"
235- android:title="@string/g_euicc_lpa_title"
236- android:icon="@drawable/ic_sim_card"
237- android:order="-14"
238- settings:controller="com.android.settings.network.GoogleEuiccLpaController"
239- settings:userRestriction="no_config_mobile_networks"/>
240-
241 <com.android.settingslib.RestrictedSwitchPreference
242 android:key="airplane_mode_on"
243 android:title="@string/airplane_mode"
244diff --git a/res/xml/top_level_settings.xml b/res/xml/top_level_settings.xml
245index 5235673651a..c7d295632fc 100644
246--- a/res/xml/top_level_settings.xml
247+++ b/res/xml/top_level_settings.xml
248@@ -231,6 +231,14 @@
249 settings:highlightableMenuKey="@string/menu_key_accounts_and_backup"
250 settings:controller="com.android.settings.backup.TopLevelAccountsAndBackupEntryPreferenceController"/>
251
252+ <com.android.settings.widget.HomepagePreference
253+ android:key="top_level_screen_time"
254+ android:title="Screen Time"
255+ android:summary="App usage, timers, focus and wind down"
256+ android:icon="@drawable/ic_timelapse"
257+ android:order="4"
258+ settings:controller="com.android.settings.supervision.TopLevelScreenTimePreferenceController"/>
259+
260 <com.android.settings.widget.HomepagePreference
261 android:key="top_level_supervision"
262 android:title="@string/supervision_settings_title"
263diff --git a/res/xml/top_level_settings_expressive.xml b/res/xml/top_level_settings_expressive.xml
264index dc7afc722c7..0127cdfea53 100644
265--- a/res/xml/top_level_settings_expressive.xml
266+++ b/res/xml/top_level_settings_expressive.xml
267@@ -226,6 +226,14 @@
268 settings:highlightableMenuKey="@string/menu_key_accounts_and_backup"
269 settings:controller="com.android.settings.backup.TopLevelAccountsAndBackupEntryPreferenceController"/>
270
271+ <com.android.settings.widget.HomepagePreference
272+ android:key="top_level_screen_time"
273+ android:title="Screen Time"
274+ android:summary="App usage, timers, focus and wind down"
275+ android:icon="@drawable/ic_homepage_screen_time"
276+ android:order="4"
277+ settings:controller="com.android.settings.supervision.TopLevelScreenTimePreferenceController"/>
278+
279 <com.android.settings.widget.HomepagePreference
280 android:key="top_level_supervision"
281 android:title="@string/supervision_settings_title"
282diff --git a/res/xml/top_level_settings_expressive_desktop.xml b/res/xml/top_level_settings_expressive_desktop.xml
283index 16335e2de93..b604deff246 100644
284--- a/res/xml/top_level_settings_expressive_desktop.xml
285+++ b/res/xml/top_level_settings_expressive_desktop.xml
286@@ -221,6 +221,14 @@
287 settings:highlightableMenuKey="@string/menu_key_accounts_and_backup"
288 settings:controller="com.android.settings.backup.TopLevelAccountsAndBackupEntryPreferenceController"/>
289
290+ <com.android.settings.widget.HomepagePreference
291+ android:key="top_level_screen_time"
292+ android:title="Screen Time"
293+ android:summary="App usage, timers, focus and wind down"
294+ android:icon="@drawable/ic_homepage_screen_time"
295+ android:order="4"
296+ settings:controller="com.android.settings.supervision.TopLevelScreenTimePreferenceController"/>
297+
298 <com.android.settings.widget.HomepagePreference
299 android:key="top_level_supervision"
300 android:title="@string/supervision_settings_title"
301diff --git a/src/com/android/settings/location/LocationServicesGeocoderPreferenceController.kt b/src/com/android/settings/location/LocationServicesGeocoderPreferenceController.kt
302deleted file mode 100644
303index 2951671fd99..00000000000
304--- a/src/com/android/settings/location/LocationServicesGeocoderPreferenceController.kt
305+++ /dev/null
306@@ -1,34 +0,0 @@
307-package com.android.settings.location
308-
309-import android.content.Context
310-import android.ext.settings.GeocoderSettings
311-import androidx.preference.PreferenceScreen
312-import com.android.settings.R
313-import com.android.settings.ext.IntSettingPrefController
314-import com.android.settings.ext.RadioButtonPickerFragment2
315-
316-/**
317- * Preference controller for Geocoder in Location Services.
318- */
319-class LocationServicesGeocoderPreferenceController(ctx: Context, key: String?) :
320- IntSettingPrefController(ctx, key, GeocoderSettings.GEOCODER_SETTING) {
321-
322- override fun addPrefsAfterList(fragment: RadioButtonPickerFragment2, screen: PreferenceScreen) {
323- addFooterPreference(screen, R.string.geocoder_footer)
324- }
325-
326- override fun getEntries(entries: Entries) {
327- entries.add(
328- R.string.geocoder_enabled_grapheneos_server,
329- GeocoderSettings.GEOCODER_SERVER_GRAPHENEOS
330- )
331- entries.add(
332- R.string.geocoder_enabled_openstreetmap_server,
333- GeocoderSettings.GEOCODER_SERVER_OPENSTREETMAP
334- )
335- entries.add(
336- R.string.geocoder_disabled,
337- GeocoderSettings.GEOCODER_DISABLED
338- )
339- }
340-}
341diff --git a/src/com/android/settings/location/LocationServicesNetworkLocationPreferenceController.kt b/src/com/android/settings/location/LocationServicesNetworkLocationPreferenceController.kt
342index 4b34ea66db5..d4c383cc0d8 100644
343--- a/src/com/android/settings/location/LocationServicesNetworkLocationPreferenceController.kt
344+++ b/src/com/android/settings/location/LocationServicesNetworkLocationPreferenceController.kt
345@@ -1,38 +1,97 @@
346+/*
347+ * Copyright (C) 2026 Modern Apps OS
348+ *
349+ * Licensed under the Apache License, Version 2.0 (the "License");
350+ * you may not use this file except in compliance with the License.
351+ * You may obtain a copy of the License at
352+ *
353+ * http://www.apache.org/licenses/LICENSE-2.0
354+ *
355+ * Unless required by applicable law or agreed to in writing, software
356+ * distributed under the License is distributed on an "AS IS" BASIS,
357+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
358+ * See the License for the specific language governing permissions and
359+ * limitations under the License.
360+ */
361 package com.android.settings.location
362
363+import android.content.ActivityNotFoundException
364+import android.content.ComponentName
365 import android.content.Context
366-import android.ext.settings.NetworkLocationSettings
367-import androidx.preference.PreferenceScreen
368+import android.content.Intent
369+import android.net.Uri
370+import android.os.UserManager
371+import android.util.Log
372+import androidx.preference.Preference
373 import com.android.settings.R
374-import com.android.settings.ext.IntSettingPrefController
375-import com.android.settings.ext.RadioButtonPickerFragment2
376+import com.android.settings.core.BasePreferenceController
377+import com.android.settingslib.RestrictedPreference
378
379 /**
380- * Preference controller for Network location in Location Services.
381+ * The single Location services row for network location and geocoding.
382+ *
383+ * This replaces GrapheneOS's separate "Network location" and "Geocoder" pickers. Both were
384+ * server choices for GrapheneOS's own NetworkLocation app, which Modern Apps OS does not ship:
385+ * the provider is pinned to [PROVIDER_PACKAGE], which is always on and answers from on-device
386+ * databases, so there is nothing left to pick. What the user can still act on is whether those
387+ * databases have been downloaded, which is what this row reports and links to.
388 */
389-class LocationServicesNetworkLocationPreferenceController(ctx: Context, key: String?) :
390- IntSettingPrefController(ctx, key, NetworkLocationSettings.NETWORK_LOCATION_SETTING) {
391+class LocationServicesNetworkLocationPreferenceController(ctx: Context, key: String) :
392+ BasePreferenceController(ctx, key) {
393+
394+ override fun getAvailabilityStatus(): Int = AVAILABLE
395+
396+ override fun updateState(preference: Preference) {
397+ (preference as RestrictedPreference)
398+ .checkRestrictionAndSetDisabled(UserManager.DISALLOW_CONFIG_LOCATION)
399+ refreshSummary(preference)
400+ }
401+
402+ override fun getSummary(): CharSequence = mContext.getString(
403+ if (databasesPresent()) {
404+ R.string.network_location_geocoding_ready
405+ } else {
406+ R.string.network_location_geocoding_setup_required
407+ }
408+ )
409
410- override fun addPrefsAfterList(fragment: RadioButtonPickerFragment2, screen: PreferenceScreen) {
411- addFooterPreference(screen, R.string.network_location_footer)
412+ override fun handlePreferenceTreeClick(preference: Preference): Boolean {
413+ if (preference.key != preferenceKey) return false
414+ val intent = Intent(Intent.ACTION_MAIN)
415+ .setComponent(ComponentName(PROVIDER_PACKAGE, PROVIDER_ACTIVITY))
416+ .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
417+ try {
418+ mContext.startActivity(intent)
419+ } catch (e: ActivityNotFoundException) {
420+ Log.e(TAG, "$PROVIDER_PACKAGE is not installed", e)
421+ }
422+ return true
423 }
424
425- override fun getEntries(entries: Entries) {
426- entries.add(
427- R.string.network_location_enabled_grapheneos_apple_proxy,
428- NetworkLocationSettings.NETWORK_LOCATION_GRAPHENEOS_APPLE_PROXY
429- )
430- entries.add(
431- R.string.network_location_enabled_apple,
432- NetworkLocationSettings.NETWORK_LOCATION_APPLE
433- )
434- entries.add(
435- R.string.network_location_enabled_apple_china,
436- NetworkLocationSettings.NETWORK_LOCATION_APPLE_CHINA
437- )
438- entries.add(
439- R.string.network_location_disabled,
440- NetworkLocationSettings.NETWORK_LOCATION_DISABLED
441- )
442+ /**
443+ * Whether the provider reports every offline database on disk.
444+ *
445+ * Absent, unreadable or malformed means "not yet", which is the same thing the user has to
446+ * act on — so a failure here degrades to "Setup required" rather than throwing in the
447+ * middle of building the Location screen.
448+ */
449+ private fun databasesPresent(): Boolean = try {
450+ mContext.contentResolver.query(STATUS_URI, null, null, null, null)?.use { cursor ->
451+ cursor.moveToFirst() && cursor.getInt(0) == 1
452+ } ?: false
453+ } catch (e: Exception) {
454+ Log.w(TAG, "could not read $STATUS_URI", e)
455+ false
456+ }
457+
458+ private companion object {
459+ const val TAG = "LocationServicesNetworkLocation"
460+
461+ const val PROVIDER_PACKAGE = "com.vayunmathur.networklocation"
462+ const val PROVIDER_ACTIVITY = "com.vayunmathur.networklocation.MainActivity"
463+
464+ /** Mirrors `DatabaseStatusContract` in the networklocation app. */
465+ val STATUS_URI: Uri =
466+ Uri.parse("content://com.vayunmathur.networklocation.status/databases")
467 }
468 }
469diff --git a/src/com/android/settings/network/GoogleEuiccLpaController.java b/src/com/android/settings/network/GoogleEuiccLpaController.java
470deleted file mode 100644
471index d697c3b97f1..00000000000
472--- a/src/com/android/settings/network/GoogleEuiccLpaController.java
473+++ /dev/null
474@@ -1,108 +0,0 @@
475-package com.android.settings.network;
476-
477-import android.Manifest;
478-import android.app.AlertDialog;
479-import android.content.Context;
480-import android.content.pm.PackageManager;
481-import android.ext.PackageId;
482-import android.os.PowerManager;
483-import android.os.UserHandle;
484-import android.permission.PermissionManager;
485-
486-import com.android.settings.R;
487-import com.android.settings.ext.AbstractTogglePrefController;
488-import com.android.settings.ext.ExtSettingControllerHelper;
489-
490-import static java.util.Objects.requireNonNull;
491-
492-public class GoogleEuiccLpaController extends AbstractTogglePrefController {
493- private static final String PKG_NAME = PackageId.G_EUICC_LPA_NAME;
494-
495- private final PackageManager packageManager;
496- private final boolean isPresent;
497-
498- public GoogleEuiccLpaController(Context context, String key) {
499- super(context, key);
500- packageManager = context.getPackageManager();
501-
502- boolean isPresent = false;
503- try {
504- var ai = packageManager.getApplicationInfo(PKG_NAME, 0);
505- isPresent = ai.isSystemApp();
506- } catch (PackageManager.NameNotFoundException ignored) {}
507-
508- this.isPresent = isPresent;
509- }
510-
511- @Override
512- public boolean isChecked() {
513- try {
514- return isPresent && packageManager.getApplicationInfo(PKG_NAME, 0).enabled;
515- } catch (PackageManager.NameNotFoundException e) {
516- return false;
517- }
518- }
519-
520- @Override
521- public int getAvailabilityStatus() {
522- if (!isPresent) {
523- return UNSUPPORTED_ON_DEVICE;
524- }
525- return ExtSettingControllerHelper.getGlobalSettingAvailability(mContext);
526- }
527-
528- private void setEnabled(boolean isEnabled) {
529- String pkg = PKG_NAME;
530-
531- if (isEnabled) {
532- var permManager = mContext.getSystemService(PermissionManager.class);
533- UserHandle user = mContext.getUser();
534-
535- String perm = Manifest.permission.CAMERA;
536- permManager.revokeRuntimePermission(pkg, perm, user, null);
537- // Previously, Camera permission was auto-granted with the FLAG_PERMISSION_SYSTEM_FIXED,
538- // which made it unchangeable by the user.
539- // Removing FLAG_PERMISSION_USER_FIXED is needed to make sure that the app is always
540- // able to show a permission request dialog after being enabled
541- int permFlagsToRemove = PackageManager.FLAG_PERMISSION_SYSTEM_FIXED
542- | PackageManager.FLAG_PERMISSION_USER_FIXED;
543- permManager.updatePermissionFlags(pkg, perm, permFlagsToRemove, 0, user);
544- }
545-
546- var powerManager = requireNonNull(mContext.getSystemService(PowerManager.class));
547-
548- int ces = isEnabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED :
549- PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
550- packageManager.setApplicationEnabledSetting(pkg, ces, 0);
551-
552- // Reboot is required in both cases:
553- // - OS code doesn't expect LPA to become unavailable at runtime and starts to poll for it
554- // with a high frequency
555- // - EuiccGoogle performs initialization in response to "(locked) boot completed" broadcasts
556- // - also, if current boot count is 1 (i.e. if this is the first boot), EuiccGoogle expects to
557- // be interacted with by Google's SetupWizard. Boot count will be at least 2 after reboot.
558- powerManager.reboot(null);
559- }
560-
561- @Override
562- public boolean setChecked(boolean isChecked) {
563- var b = new AlertDialog.Builder(mContext);
564-
565- int msg;
566- int btnText;
567- if (isChecked) {
568- msg = R.string.g_euicc_lpa_enable_dialog_msg;
569- btnText = R.string.g_euicc_lpa_restart_button;
570- } else {
571- b.setTitle(R.string.g_euicc_lpa_disable_dialog_title);
572- msg = R.string.g_euicc_lpa_disable_dialog_msg;
573- btnText = R.string.g_euicc_lpa_proceed_button;
574- }
575-
576- b.setMessage(msg);
577- b.setPositiveButton(btnText, (d, btn) -> setEnabled(isChecked));
578- b.show();
579-
580- return false;
581- }
582-}
583diff --git a/src/com/android/settings/network/telephony/ToggleSubscriptionDialogActivity.java b/src/com/android/settings/network/telephony/ToggleSubscriptionDialogActivity.java
584index 7c70d9165e7..a81b2b4edd8 100644
585--- a/src/com/android/settings/network/telephony/ToggleSubscriptionDialogActivity.java
586+++ b/src/com/android/settings/network/telephony/ToggleSubscriptionDialogActivity.java
587@@ -18,8 +18,6 @@ package com.android.settings.network.telephony;
588
589 import android.content.Context;
590 import android.content.Intent;
591-import android.content.pm.PackageManager;
592-import android.ext.PackageId;
593 import android.os.Bundle;
594 import android.os.UserManager;
595 import android.telephony.SubscriptionInfo;
596@@ -123,14 +121,6 @@ public class ToggleSubscriptionDialogActivity extends SubscriptionActionDialogAc
597 == View.LAYOUT_DIRECTION_RTL;
598 Log.i(TAG, "isMultipleEnabledProfilesSupported():" + isMultipleEnabledProfilesSupported());
599
600- if (shouldDisallowDisablingEsim()) {
601- Log.i(TAG, "Cannot disable eSIM while eSIM support is disabled.");
602- showErrorDialog(
603- getString(R.string.sim_action_esim_support_disabled_title),
604- getString(R.string.sim_action_esim_support_disabled_text));
605- return;
606- }
607-
608 if (savedInstanceState == null) {
609 if (mEnable) {
610 showEnableSubDialog();
611@@ -608,47 +598,4 @@ public class ToggleSubscriptionDialogActivity extends SubscriptionActionDialogAc
612 cardInfo -> cardInfo.isMultipleEnabledProfilesSupported());
613 }
614
615- private boolean shouldDisallowDisablingEsim() {
616- if (mEnable || mSubInfo == null) {
617- return false;
618- }
619- final boolean isActiveSub =
620- mSubInfo.getSimSlotIndex() != SubscriptionManager.INVALID_SIM_SLOT_INDEX;
621- final boolean isEuiccSub = isEuiccSubscription(mSubInfo);
622- final boolean isEsimSupportEnabled = isEsimSupportEnabled();
623- Log.d(TAG, "shouldDisallowDisablingEsim: isActive=" + isActiveSub
624- + ", isEuiccSub=" + isEuiccSub
625- + ", isEmbedded=" + mSubInfo.isEmbedded()
626- + ", cardId=" + mSubInfo.getCardId()
627- + ", isEsimSupportEnabled=" + isEsimSupportEnabled);
628- return isActiveSub && isEuiccSub && !isEsimSupportEnabled;
629- }
630-
631- private boolean isEuiccSubscription(SubscriptionInfo subInfo) {
632- /* subInfo doesn't contain accurate eSIM profile info before eUICC LPA is
633- * enabled for the first time, but it should be valid afterward.
634- */
635- if (subInfo.isEmbedded()) {
636- return true;
637- }
638- final int cardId = subInfo.getCardId();
639- final List<UiccCardInfo> cardsInfo = mTelMgr.getUiccCardsInfo();
640- if (cardId > TelephonyManager.UNSUPPORTED_CARD_ID) {
641- if (cardsInfo.stream().anyMatch(cardInfo ->
642- cardInfo != null && cardInfo.getCardId() == cardId && cardInfo.isEuicc())) {
643- return true;
644- }
645- }
646- return false;
647- }
648-
649- private boolean isEsimSupportEnabled() {
650- try {
651- return getPackageManager()
652- .getApplicationInfo(PackageId.G_EUICC_LPA_NAME, PackageManager.MATCH_SYSTEM_ONLY)
653- .enabled;
654- } catch (PackageManager.NameNotFoundException e) {
655- return true;
656- }
657- }
658 }
659diff --git a/src/com/android/settings/supervision/SupervisionDashboardActivity.kt b/src/com/android/settings/supervision/SupervisionDashboardActivity.kt
660index cbc52e60a8a..1b5bd0e884e 100644
661--- a/src/com/android/settings/supervision/SupervisionDashboardActivity.kt
662+++ b/src/com/android/settings/supervision/SupervisionDashboardActivity.kt
663@@ -42,6 +42,19 @@ class SupervisionDashboardActivity :
664
665 override fun onResume() {
666 super.onResume()
667+ // MAOS: the AOSP supervision dashboard is replaced by the Modern Apps Parental Controls
668+ // app; redirect any entry (search, embedding, direct launch) into it and finish.
669+ run {
670+ val maosRedirect =
671+ Intent("com.vayunmathur.parentalcontrols.action.DASHBOARD")
672+ .setPackage("com.vayunmathur.parentalcontrols")
673+ .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
674+ if (packageManager.queryIntentActivities(maosRedirect, 0).isNotEmpty()) {
675+ startActivity(maosRedirect)
676+ finish()
677+ return
678+ }
679+ }
680
681 if (!Flags.enableSupervisionSettingsUiUpdates() && shouldRedirectToSupervisionApp()) {
682 val redirectIntent = getSupervisionAppIntent()
683diff --git a/src/com/android/settings/supervision/TopLevelSupervisionPreferenceController.kt b/src/com/android/settings/supervision/TopLevelSupervisionPreferenceController.kt
684index c689a201ec0..14b2bbdba72 100644
685--- a/src/com/android/settings/supervision/TopLevelSupervisionPreferenceController.kt
686+++ b/src/com/android/settings/supervision/TopLevelSupervisionPreferenceController.kt
687@@ -44,8 +44,11 @@ class TopLevelSupervisionPreferenceController(context: Context, key: String) :
688
689 override fun handlePreferenceTreeClick(preference: Preference): Boolean {
690 if (preference.key == preferenceKey) {
691- val intent = Intent(mContext, SupervisionDashboardActivity::class.java)
692- intent.putExtra(EXTRA_IS_SECOND_LAYER_PAGE, true)
693+ // MAOS: open the Modern Apps Parental Controls app instead of the AOSP dashboard.
694+ val intent =
695+ Intent("com.vayunmathur.parentalcontrols.action.DASHBOARD")
696+ .setPackage("com.vayunmathur.parentalcontrols")
697+ .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
698 mContext.startActivity(intent)
699 return true
700 }
701@@ -69,3 +72,34 @@ class TopLevelSupervisionPreferenceController(context: Context, key: String) :
702 return AVAILABLE
703 }
704 }
705+
706+
707+/**
708+ * MAOS: top-level "Screen Time" entry that opens the Modern Apps Screen Time app.
709+ *
710+ * Lives in this tracked file (rather than a new source file) so settings.patch stays a set of
711+ * edits to existing files and re-applies cleanly after repo sync. The Screen Time app has no
712+ * launcher icon, so this is its entry point; shown only when it answers its dashboard action.
713+ */
714+class TopLevelScreenTimePreferenceController(context: Context, key: String) :
715+ BasePreferenceController(context, key) {
716+
717+ override fun getAvailabilityStatus(): Int =
718+ if (mContext.packageManager.queryIntentActivities(dashboardIntent(), 0).isNotEmpty()) {
719+ AVAILABLE
720+ } else {
721+ UNSUPPORTED_ON_DEVICE
722+ }
723+
724+ override fun handlePreferenceTreeClick(preference: Preference): Boolean {
725+ if (preference.key == preferenceKey) {
726+ mContext.startActivity(dashboardIntent().addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
727+ return true
728+ }
729+ return super.handlePreferenceTreeClick(preference)
730+ }
731+
732+ private fun dashboardIntent(): Intent =
733+ Intent("com.vayunmathur.screentime.action.DASHBOARD")
734+ .setPackage("com.vayunmathur.screentime")
735+}
736diff --git a/res/drawable/ic_homepage_screen_time.xml b/res/drawable/ic_homepage_screen_time.xml
737new file mode 100644
738index 00000000000..6c2eb9eee03
739--- /dev/null
740+++ b/res/drawable/ic_homepage_screen_time.xml
741@@ -0,0 +1,33 @@
742+<?xml version="1.0" encoding="utf-8"?>
743+<!--
744+ Copyright (C) 2026 The Android Open Source Project
745+
746+ Licensed under the Apache License, Version 2.0 (the "License");
747+ you may not use this file except in compliance with the License.
748+ You may obtain a copy of the License at
749+
750+ http://www.apache.org/licenses/LICENSE-2.0
751+
752+ Unless required by applicable law or agreed to in writing, software
753+ distributed under the License is distributed on an "AS IS" BASIS,
754+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
755+ See the License for the specific language governing permissions and
756+ limitations under the License.
757+ -->
758+
759+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
760+
761+ <item>
762+ <com.android.settingslib.widget.AdaptiveIconShapeDrawable
763+ android:width="@dimen/dashboard_tile_image_size"
764+ android:height="@dimen/dashboard_tile_image_size"
765+ android:color="@color/homepage_supervision_background" />
766+ </item>
767+
768+ <item
769+ android:width="@dimen/dashboard_tile_foreground_image_size"
770+ android:height="@dimen/dashboard_tile_foreground_image_size"
771+ android:start="@dimen/dashboard_tile_foreground_image_inset"
772+ android:top="@dimen/dashboard_tile_foreground_image_inset"
773+ android:drawable="@drawable/ic_settings_screen_time_expressive" />
774+</layer-list>
775diff --git a/res/drawable/ic_settings_screen_time_expressive.xml b/res/drawable/ic_settings_screen_time_expressive.xml
776new file mode 100644
777index 00000000000..8103a8b868e
778--- /dev/null
779+++ b/res/drawable/ic_settings_screen_time_expressive.xml
780@@ -0,0 +1,19 @@
781+<!--
782+ Copyright (C) 2026 The Android Open Source Project
783+
784+ Licensed under the Apache License, Version 2.0 (the "License");
785+ you may not use this file except in compliance with the License.
786+ You may obtain a copy of the License at
787+
788+ http://www.apache.org/licenses/LICENSE-2.0
789+
790+ Unless required by applicable law or agreed to in writing, software
791+ distributed under the License is distributed on an "AS IS" BASIS,
792+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
793+ See the License for the specific language governing permissions and
794+ limitations under the License.
795+ -->
796+<com.android.settings.widget.TintDrawable
797+ xmlns:android="http://schemas.android.com/apk/res/android"
798+ android:drawable="@drawable/ic_timelapse_shape"
799+ android:tint="@color/homepage_supervision_foreground" />
800diff --git a/src/com/android/settings/location/GnssSuplPrefController.java b/src/com/android/settings/location/GnssSuplPrefController.java
801index 95be474c9de03f45e0ed05ab5e054e913bd0b633..6f2b3198ddeb9d018d75e7742965d98cf74591cf 100644
802--- a/src/com/android/settings/location/GnssSuplPrefController.java
803+++ b/src/com/android/settings/location/GnssSuplPrefController.java
804@@ -34,7 +34,6 @@
805 @Override
806 protected void getEntries(Entries entries) {
807 entries.add(R.string.supl_enabled_grapheneos_proxy, GnssSettings.SUPL_SERVER_GRAPHENEOS_PROXY);
808- entries.add(R.string.supl_enabled_standard_server, GnssSettings.SUPL_SERVER_STANDARD);
809 entries.add(R.string.supl_disabled, R.string.supl_disabled_summary, GnssSettings.SUPL_DISABLED);
810 }
811 }
812diff --git a/src/com/android/settings/location/GnssPsdsPrefController.java b/src/com/android/settings/location/GnssPsdsPrefController.java
813index 73279f2d23a0b2c416fc42ba5c0a3cbbd923a137..f1d9e09384b175937492c2349d8533b644f14e18 100644
814--- a/src/com/android/settings/location/GnssPsdsPrefController.java
815+++ b/src/com/android/settings/location/GnssPsdsPrefController.java
816@@ -43,7 +43,6 @@
817 @Override
818 protected void getEntries(Entries entries) {
819 entries.add(R.string.psds_enabled_grapheneos_server, GnssSettings.PSDS_SERVER_GRAPHENEOS);
820- entries.add(R.string.psds_enabled_standard_server, GnssSettings.PSDS_SERVER_STANDARD);
821 entries.add(R.string.psds_disabled, R.string.psds_disabled_summary, GnssSettings.PSDS_DISABLED);
822 }
823 }
824diff --git a/res/values/strings_ext.xml b/res/values/strings_ext.xml
825index 0b19916d085541257007bec7ad0c8de84066a50f..a20289c2822d5d908d36e84db2710ec070e2b5ab 100644
826--- a/res/values/strings_ext.xml
827+++ b/res/values/strings_ext.xml
828@@ -49,7 +49,7 @@
829 <string name="pref_gnss_supl_title">Secure User Plane Location (SUPL)</string>
830 <string name="pref_gnss_supl_footer">A-GNSS (assisted satellite geolocation) based on nearby cell towers.</string>
831
832- <string name="supl_enabled_grapheneos_proxy">GrapheneOS proxy</string>
833+ <string name="supl_enabled_grapheneos_proxy">MAOS servers</string>
834 <string name="supl_enabled_standard_server">Standard server</string>
835 <string name="supl_disabled">Off</string>
836 <string name="supl_disabled_summary">Will make acquiring location lock significantly slower, especially if PSDS is turned off too</string>
837@@ -79,7 +79,7 @@
838 "If PSDS is turned on, static PSDS information files will be downloaded periodically to improve location resolution speed and accuracy.
839 No query or data is sent to the server. These files contain orbits and statuses of satellites, Earth environmental data and time adjustment information."
840 </string>
841- <string name="psds_enabled_grapheneos_server">GrapheneOS server</string>
842+ <string name="psds_enabled_grapheneos_server">MAOS servers</string>
843 <string name="psds_enabled_standard_server">Standard server</string>
844 <string name="psds_disabled">Off</string>
845 <string name="psds_disabled_summary">Will make acquiring location lock significantly slower, especially if SUPL is turned off too</string>
846@@ -88,7 +88,7 @@
847
848 <string name="storage_scopes">Storage Scopes</string>
849
850- <string name="conn_checks_grapheneos_server">GrapheneOS server</string>
851+ <string name="conn_checks_grapheneos_server">MAOS servers</string>
852 <string name="conn_checks_google_server">Standard (Google) server</string>
853 <string name="conn_checks_disabled">Off</string>
854