Modern Apps git

← MAOS.git

maos: swap keyboard for LatinIME, add speech as default TTS/STT, remove Auditor

Commit
952c5535d3f318a737be16d842f3f858c9381b60
Author
Vayun Mathur <[email protected]>
When
2026-08-09 18:18 UTC (3 months ago)
Parents
80d83d3

Diff

Android.bp
diff --git a/Android.bp b/Android.bpindex ae888d1..4442d2c 100644--- a/Android.bp+++ b/Android.bp@@ -104,3 +104,28 @@ android_app_import {         enabled: false,     }, }++// Keyboard replaces AOSP LatinIME as the system IME. Direct Boot support (for lock-screen+// input after a reboot) is declared in the keyboard app's own manifest, not here.+android_app_import {+    name: "ModernAppsKeyboard",+    apk: "prebuilts/keyboard-release.apk",+    presigned: true,+    product_specific: true,+    dex_preopt: {+        enabled: false,+    },+}++// Speech is the default on-device STT (RecognitionService) and TTS (TextToSpeech) engine.+// Additive — AOSP ships neither. Wired up via config_default*SpeechRecognitionService and,+// for TTS, by being the only installed engine (see modern_apps.mk / overlay).+android_app_import {+    name: "ModernAppsSpeech",+    apk: "prebuilts/speech-release.apk",+    presigned: true,+    product_specific: true,+    dex_preopt: {+        enabled: false,+    },+}
README.md
diff --git a/README.md b/README.mdindex aa08f8d..2a7abf0 100644--- a/README.md+++ b/README.md@@ -22,6 +22,8 @@ repo.) | Files | `com.vayunmathur.files` | **DocumentsUI** (Files also takes over the SAF role — see below) | | Photos | `com.vayunmathur.photos` | AOSP Gallery | | App Store | `com.vayunmathur.appstore` | GrapheneOS Apps |+| Keyboard | `com.vayunmathur.keyboard` | AOSP LatinIME (Direct Boot-aware for lock-screen input) |+| Speech | `com.vayunmathur.speech` | *(additive)* default on-device STT + TTS |  ## Layout 
build-maos.sh
diff --git a/build-maos.sh b/build-maos.shindex 3b1ef22..6e4a10d 100755--- a/build-maos.sh+++ b/build-maos.sh@@ -64,7 +64,7 @@ BUILD="$TAG" MANIFEST_URL="https://github.com/GrapheneOS/platform_manifest.git" MAOS_GH="https://github.com/vayun-mathur/"     # overlay repo remote (for the local manifest) MODERN_APPS_GH="vayun-mathur/Modern-Apps"      # source of the prebuilt APKs-APPS=(web camera pdf contacts calculator clock files photos appstore)+APPS=(web camera pdf contacts calculator clock files photos appstore keyboard speech)  # ---- Derived / optional-env config ---- MAOS_KEYS_FILE="${MAOS_KEYS_FILE:-$HOME/maos-keys/$DEVICE.keys.tar.gz.scrypt}"
default-permissions-modern-apps.xml
diff --git a/default-permissions-modern-apps.xml b/default-permissions-modern-apps.xmlnew file mode 100644index 0000000..d5d59bc--- /dev/null+++ b/default-permissions-modern-apps.xml@@ -0,0 +1,12 @@+<?xml version="1.0" encoding="utf-8"?>+<!--+  Default runtime-permission grants for Modern Apps that act as headless system services.+  Copied to /product/etc/default-permissions/ by modern_apps.mk. Without this, the Speech+  app (default on-device recognizer + TTS engine) would have no RECORD_AUDIO until a user+  manually granted it, so voice input would fail out of the box.+-->+<exceptions>+    <exception package="com.vayunmathur.speech">+        <permission name="android.permission.RECORD_AUDIO" fixed="false" />+    </exception>+</exceptions>
modern_apps.mk
diff --git a/modern_apps.mk b/modern_apps.mkindex 394496b..0a56af4 100644--- a/modern_apps.mk+++ b/modern_apps.mk@@ -18,7 +18,9 @@ PRODUCT_PACKAGES += \     ModernAppsClock \     ModernAppsFiles \     ModernAppsPhotos \-    ModernAppsStore+    ModernAppsStore \+    ModernAppsKeyboard \+    ModernAppsSpeech  # 2. Remove the stock userspace apps we're replacing. #    There is no PRODUCT_PACKAGES -= operator, so we filter them out. This only works@@ -33,7 +35,9 @@ PRODUCT_PACKAGES := $(filter-out \     DeskClock \     Calculator \     Gallery2 \-    DocumentsUI, \+    DocumentsUI \+    LatinIME \+    Auditor, \     $(PRODUCT_PACKAGES))  # NOTE on the browser (Vanadium): Vanadium provides BOTH the default browser AND the@@ -44,10 +48,25 @@ PRODUCT_PACKAGES := $(filter-out \ # tree and add it to the filter-out list above — do NOT remove the WebView/Trichrome # modules. +# NOTE on speech: Modern Apps Speech is ADDITIVE (AOSP ships no default TTS/STT engine).+# It becomes the default on-device recognizer via config_default*SpeechRecognitionService+# (overlay) and, being the only installed TTS engine, the default TTS engine. Its+# RECORD_AUDIO runtime permission must be granted by default for the recognizer to work+# headless — see the default-permissions grant referenced below.++# NOTE on the keyboard: Modern Apps Keyboard replaces AOSP LatinIME as the IME. For it to+# work on the lock screen after a reboot it must be Direct Boot aware; that attribute is set+# in the keyboard app's own manifest (Modern-Apps repo). With LatinIME removed it is the sole+# preinstalled IME, so the system enables/selects it by default.+ # 3. Static resource overlays: config_defaultBrowser, config_documentsUiPackage,-#    WebView allowlist, branding.+#    speech recognition service, WebView allowlist, branding. PRODUCT_PACKAGE_OVERLAYS += vendor/modern-apps/overlay +# 3b. Default-permission grant so the Speech recognizer/TTS gets RECORD_AUDIO headlessly.+PRODUCT_COPY_FILES += \+    vendor/modern-apps/default-permissions-modern-apps.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/default-permissions/default-permissions-modern-apps.xml+ # 4. Privileged-permission allowlist so Files (priv-app) may hold MANAGE_DOCUMENTS. PRODUCT_COPY_FILES += \     vendor/modern-apps/privapp-permissions-modern-apps.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/privapp-permissions-modern-apps.xml@@ -57,7 +76,7 @@ $(call inherit-product-if-exists, vendor/modern-apps/maos_branding.mk)  # 6. Build-time guard: fail the build if any stock app we meant to drop is still in #    PRODUCT_PACKAGES (catches upstream module renames that would silently re-add it).-_maos_leaked := $(filter Camera PdfViewer Apps Contacts DeskClock Calculator Gallery2 DocumentsUI,$(PRODUCT_PACKAGES))+_maos_leaked := $(filter Camera PdfViewer Apps Contacts DeskClock Calculator Gallery2 DocumentsUI LatinIME Auditor,$(PRODUCT_PACKAGES)) ifneq ($(_maos_leaked),) $(error MAOS: stock apps still present in PRODUCT_PACKAGES: $(_maos_leaked). Update the filter-out list in vendor/modern-apps/modern_apps.mk) endif
overlay/frameworks/base/core/res/res/values/config.xml
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xmlindex 10a73e5..4b0ab74 100644--- a/overlay/frameworks/base/core/res/res/values/config.xml+++ b/overlay/frameworks/base/core/res/res/values/config.xml@@ -14,4 +14,11 @@          that registers the SAF picker intents and holds MANAGE_DOCUMENTS (allowlisted in          privapp-permissions-modern-apps.xml). -->     <string name="config_documentsUiPackage" translatable="false">com.vayunmathur.files</string>++    <!-- Default speech recognition (STT) -> Modern Apps Speech (Whisper, on-device).+         AOSP ships no default recognizer; this makes SpeechRecognizer work offline. -->+    <string name="config_defaultSpeechRecognitionService" translatable="false">com.vayunmathur.speech/.service.WhisperRecognitionService</string>+    <string name="config_defaultOnDeviceSpeechRecognitionService" translatable="false">com.vayunmathur.speech/.service.WhisperRecognitionService</string>+    <!-- TTS: Modern Apps Speech (Piper) is the only installed engine, so the framework+         selects it as the default TTS engine automatically; no dedicated config exists. --> </resources>
scripts/collect-apks.sh
diff --git a/scripts/collect-apks.sh b/scripts/collect-apks.shindex 6e8b8aa..f57a465 100755--- a/scripts/collect-apks.sh+++ b/scripts/collect-apks.sh@@ -21,7 +21,7 @@ SRC="${1:?usage: collect-apks.sh <path to Modern-Apps repo, its distribution_apk DEST="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/prebuilts" mkdir -p "$DEST" -APPS=(web camera pdf contacts calculator clock files photos appstore)+APPS=(web camera pdf contacts calculator clock files photos appstore keyboard speech)  find_apk() {   local app="$1"