communicate: declare carrier service for MA-OS privilege grant
- Commit
36abedebab9e9883b660bc04f4071158e471dc59- Author
- vayun-mathur <[email protected]>
- When
- 2026-09-27 17:35 UTC (2 months ago)
- Parents
dc0f0da
Diff
communicate/src/main/AndroidManifest.xml
diff --git a/communicate/src/main/AndroidManifest.xml b/communicate/src/main/AndroidManifest.xmlindex 1bed82f365..a9dfa4b541 100644--- a/communicate/src/main/AndroidManifest.xml+++ b/communicate/src/main/AndroidManifest.xml@@ -213,6 +213,22 @@ android:exported="false" android:foregroundServiceType="remoteMessaging" /> + <!-- Carrier service for the MA-OS privilege grant (UiccCarrierPrivilegeRules+ reports this app as privileged): lets the platform select us as the carrier+ service, which unblocks IMS socket bind + single-reg delegate on carriers+ whose UICC profiles carry no rules. -->+ <service+ android:name=".telephony.CommunicateCarrierService"+ android:exported="true"+ android:permission="android.permission.BIND_CARRIER_SERVICES">+ <intent-filter>+ <action android:name="android.service.carrier.CarrierService" />+ </intent-filter>+ <meta-data+ android:name="android.service.carrier.LONG_LIVED_BINDING"+ android:value="true" />+ </service>+ <service android:name=".telephony.GoogleVoiceCallForegroundService" android:exported="false"
communicate/src/main/java/com/vayunmathur/communicate/telephony/CommunicateCarrierService.kt
diff --git a/communicate/src/main/java/com/vayunmathur/communicate/telephony/CommunicateCarrierService.kt b/communicate/src/main/java/com/vayunmathur/communicate/telephony/CommunicateCarrierService.ktnew file mode 100644index 0000000000..da6da9c645--- /dev/null+++ b/communicate/src/main/java/com/vayunmathur/communicate/telephony/CommunicateCarrierService.kt@@ -0,0 +1,25 @@+package com.vayunmathur.communicate.telephony++import android.os.PersistableBundle+import android.service.carrier.CarrierIdentifier+import android.service.carrier.CarrierService++/**+ * Carrier service declaration for the MA-OS privilege grant.+ *+ * MA-OS patches `UiccCarrierPrivilegeRules` to report+ * `com.vayunmathur.communicate` as carrier-privileged regardless of UICC+ * rules. That alone unlocks `hasCarrierPrivileges()` (SIP delegate, GBA,+ * UCE). The IMS *socket bind* additionally requires the platform to select+ * us as the carrier *service* (`CarrierPrivilegeAuthenticator` matches the+ * bound service UID): this service, with `LONG_LIVED_BINDING`, is what gets+ * selected once the privilege grant lands.+ *+ * `onLoadConfig` returns an empty bundle — we don't override carrier config,+ * we only need the binding identity. Never started directly; the platform+ * binds it.+ */+class CommunicateCarrierService : CarrierService() {+ override fun onLoadConfig(id: CarrierIdentifier): PersistableBundle =+ PersistableBundle()+}