Modern Apps git

← MAOS.git

maos: ship framework-res config as explicit static RRO to avoid auto-RRO collision

Commit
9ba307e461d4fa08740ebfa186c69f674e25b06c
Author
Vayun Mathur <[email protected]>
When
2026-08-10 22:26 UTC (3 months ago)
Parents
0caa3ca

Diff

modern_apps.mk
diff --git a/modern_apps.mk b/modern_apps.mkindex 5f0affb..c902c9d 100644--- a/modern_apps.mk+++ b/modern_apps.mk@@ -94,8 +94,19 @@ PRODUCT_PACKAGES := $(filter-out $(_maos_remove),$(PRODUCT_PACKAGES)) # `NetworkLocation` is a provider *implementation* app, NOT a content-provider backend — it does not # end in `Provider`, so the safety guard above correctly permits removing it. -# 3. Static resource overlays: config_defaultBrowser, config_documentsUiPackage,-#    speech recognition service, WebView allowlist, branding.+# 3. framework-res config (default browser, documents UI, speech recognition service, and the+#    geocoder / network-location provider pins + their override bools) ships as an explicit+#    static, platform-signed RRO. With PRODUCT_ENFORCE_RRO_TARGETS := * (from generic_system.mk)+#    a plain PRODUCT_PACKAGE_OVERLAYS on framework-res is turned into an auto-generated product+#    RRO named framework-res__$(PRODUCT_NAME)__auto_generated_rro_product.apk, which collides+#    with the identically named prebuilt adevtool ships under vendor/google_devices/<dev>/overlays+#    (soong "packaging conflict"). An explicit module has a unique name and coexists with it.+#    platform signing is required to overlay the non-public config_* resources; isStatic makes it+#    always-on at boot. See vendor/modern-apps/rro/MaosFrameworkResRRO/.+PRODUCT_PACKAGES += MaosFrameworkResRRO++#    The overlay/ dir now only carries the GrapheneOS Updater OTA-URL overlay (no framework-res+#    overlay here, so no auto-generated framework-res RRO is produced). PRODUCT_PACKAGE_OVERLAYS += vendor/modern-apps/overlay  # 3b. Default-permission grant so the Speech recognizer/TTS gets RECORD_AUDIO headlessly.
rro/MaosFrameworkResRRO/Android.bp
diff --git a/rro/MaosFrameworkResRRO/Android.bp b/rro/MaosFrameworkResRRO/Android.bpnew file mode 100644index 0000000..70384e2--- /dev/null+++ b/rro/MaosFrameworkResRRO/Android.bp@@ -0,0 +1,20 @@+// MAOS framework-res config overlay, packaged as an explicit static, platform-signed RRO.+//+// Why not PRODUCT_PACKAGE_OVERLAYS: with PRODUCT_ENFORCE_RRO_TARGETS := * (from+// generic_system.mk) a product overlay on framework-res becomes an auto-generated RRO named+// framework-res__<device>__auto_generated_rro_product.apk, which collides with the prebuilt of+// the same name that adevtool ships under vendor/google_devices/<device>/overlays. An explicit+// module has a unique name and coexists with the prebuilt.+//+// certificate: "platform" is required to overlay the non-public framework config_* resources+// (config_documentsUiPackage, config_default*SpeechRecognitionService, the geocoder /+// network-location provider pins and their config_enable*Overlay bools). isStatic (in the+// manifest) makes it always-on and applied early enough to take effect at boot. This mirrors+// AOSP's own CarFrameworkResConfigRRO (packages/services/Car/.../rro/overlay-config/androidRRO).+runtime_resource_overlay {+    name: "MaosFrameworkResRRO",+    resource_dirs: ["res"],+    certificate: "platform",+    manifest: "AndroidManifest.xml",+    product_specific: true,+}
rro/MaosFrameworkResRRO/AndroidManifest.xml
diff --git a/rro/MaosFrameworkResRRO/AndroidManifest.xml b/rro/MaosFrameworkResRRO/AndroidManifest.xmlnew file mode 100644index 0000000..ad4b02f--- /dev/null+++ b/rro/MaosFrameworkResRRO/AndroidManifest.xml@@ -0,0 +1,11 @@+<?xml version="1.0" encoding="utf-8"?>+<manifest xmlns:android="http://schemas.android.com/apk/res/android"+          package="com.vayunmathur.maos.overlay.frameworkres">+    <application android:hasCode="false" />+    <!-- targetPackage "android" == framework-res. isStatic: always-on, applied at boot.+         priority above adevtool's product RRO (priority 1) so MAOS values win on overlap. -->+    <overlay+        android:targetPackage="android"+        android:isStatic="true"+        android:priority="10" />+</manifest>
rro/MaosFrameworkResRRO/res/values/config.xml
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/rro/MaosFrameworkResRRO/res/values/config.xmlsimilarity index 87%rename from overlay/frameworks/base/core/res/res/values/config.xmlrename to rro/MaosFrameworkResRRO/res/values/config.xmlindex 386b6ef..da387d5 100644--- a/overlay/frameworks/base/core/res/res/values/config.xml+++ b/rro/MaosFrameworkResRRO/res/values/config.xml@@ -1,8 +1,9 @@ <?xml version="1.0" encoding="utf-8"?>-<!---  Static resource overlay for frameworks/base/core/res.-  Pulled in via PRODUCT_PACKAGE_OVERLAYS += vendor/modern-apps/overlay (see modern_apps.mk).--->+<!-- MAOS framework-res overrides, shipped as an explicit static, platform-signed RRO+     (module MaosFrameworkResRRO). Moved here from the former+     overlay/frameworks/base/core/res/res/values/config.xml so PRODUCT_PACKAGE_OVERLAYS no+     longer generates an auto-generated framework-res RRO that collides with adevtool's prebuilt.+     framework-res.apk itself stays unmodified. --> <resources>     <!-- Default browser role -> Modern Apps Web.          Vanadium remains installed as the system WebView provider; this only changes