Modern Apps git

← MAOS.git

maos: make share privileged for AirDrop over the Mosey HAL

Commit
9d879193d1239592c7e6956d63c7c5ed71dfd5ad
Author
Vayun Mathur <[email protected]>
When
2026-10-26 01:59 UTC (1 month ago)
Parents
eae65c6

Diff

Android.bp
diff --git a/Android.bp b/Android.bpindex bd31380..ccdb33d 100644--- a/Android.bp+++ b/Android.bp@@ -220,11 +220,17 @@ android_app_import {     }, } +// Share is PRIVILEGED for AirDrop over Google's Mosey (AWDL) HAL: publishing the `mosey0`+// interface as a network needs CREATE_APP_SPECIFIC_NETWORK, and binding sockets/mDNS to that+// restricted network needs CONNECTIVITY_USE_RESTRICTED_NETWORKS. Both are signature|privileged+// and allowlisted in privapp-permissions-modern-apps.xml. Without a Mosey HAL on the device the+// app falls back to AirDrop over the Wi-Fi LAN and these permissions go unused. android_app_import {     name: "ModernAppsShare",     apk: "prebuilts/share-release.apk",     presigned: true,     preprocessed: true,+    privileged: true,     product_specific: true,     dex_preopt: {         enabled: false,
privapp-permissions-modern-apps.xml
diff --git a/privapp-permissions-modern-apps.xml b/privapp-permissions-modern-apps.xmlindex 56c8dec..ebf326b 100644--- a/privapp-permissions-modern-apps.xml+++ b/privapp-permissions-modern-apps.xml@@ -28,6 +28,15 @@     <!-- Euicc is the system eSIM LPA (declares EuiccService). Managing embedded subscriptions          and driving the eUICC over a telephony logical channel requires these signature|privileged          perms. Replaces Google's EuiccGoogle LPA; the EuiccSupportPixel hardware backend is kept. -->+    <!-- Share drives Google's Mosey (AWDL) HAL for AirDrop and publishes its `mosey0` interface+         as an app-specific network (ConnectivityService accepts CREATE_APP_SPECIFIC_NETWORK in place+         of NETWORK_FACTORY, which is signature|role). Binding sockets and mDNS to that restricted+         network needs CONNECTIVITY_USE_RESTRICTED_NETWORKS. -->+    <privapp-permissions package="com.vayunmathur.share">+        <permission name="android.permission.CREATE_APP_SPECIFIC_NETWORK" />+        <permission name="android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS" />+    </privapp-permissions>+     <privapp-permissions package="com.vayunmathur.euicc">         <permission name="android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS" />         <permission name="android.permission.MODIFY_PHONE_STATE" />
sysconfig-modern-apps.xml
diff --git a/sysconfig-modern-apps.xml b/sysconfig-modern-apps.xmlindex c0a707d..74329d6 100644--- a/sysconfig-modern-apps.xml+++ b/sysconfig-modern-apps.xml@@ -50,6 +50,13 @@          only because we hold the supervision role. The exemption buys visibility, not privilege. -->     <hidden-api-whitelisted-app package="com.vayunmathur.parentalcontrols" />     <hidden-api-whitelisted-app package="com.vayunmathur.screentime" />++    <!-- Share reaches the Mosey (AWDL) HAL for AirDrop through hidden framework members:+         ServiceManager.isDeclared / waitForDeclaredService to find IMoseyService, and the hidden+         LinkProperties / LinkAddress / RouteInfo / NetworkCapabilities.Builder members needed to+         publish `mosey0`. Like cast above, a presigned app needs this exemption for the reflection+         to resolve; the framework still enforces the permissions behind each call. -->+    <hidden-api-whitelisted-app package="com.vayunmathur.share" />     <!-- Emergency (com.vayunmathur.emergency) replaces AOSP EmergencyInfo. The SOS          countdown runs as a foreground service off an exact alarm; exempt it from Doze          like stock does so the countdown is not killed while the screen is off. -->