MAOS.git
Publicgit clone https://git.maproj.org/MAOS.gitMAOS.git / patches / frameworks_opt_telephony.patch
frameworks_opt_telephony.patch50 lines · 3.0 KiBRaw
| 1 | diff --git a/src/java/com/android/internal/telephony/CarrierPrivilegesTracker.java b/src/java/com/android/internal/telephony/CarrierPrivilegesTracker.java |
| 2 | index b1f6a0c623..25b5d71a48 100644 |
| 3 | --- a/src/java/com/android/internal/telephony/CarrierPrivilegesTracker.java |
| 4 | +++ b/src/java/com/android/internal/telephony/CarrierPrivilegesTracker.java |
| 5 | @@ -829,6 +829,12 @@ public class CarrierPrivilegesTracker extends Handler { |
| 6 | |
| 7 | private boolean isPackageMaybePrivileged( |
| 8 | @NonNull String pkgName, @NonNull Set<Integer> hashHashes) { |
| 9 | + // MAOS: the bundled Communicate app is treated as carrier-privileged |
| 10 | + // regardless of UICC/carrier-config rules (e.g. Jibe-backed MVNO profiles |
| 11 | + // carry no rules). Skips the cert-hash pre-filter below. |
| 12 | + if ("com.vayunmathur.communicate".equals(pkgName)) { |
| 13 | + return true; |
| 14 | + } |
| 15 | for (Integer hashHash : hashHashes) { |
| 16 | // Non-null (whether empty or not) test override rule will ignore the UICC and CC rules |
| 17 | if (mTestOverrideRules != null) { |
| 18 | @@ -860,6 +866,12 @@ public class CarrierPrivilegesTracker extends Handler { |
| 19 | * carrier config, from test overrides or from certificates stored on the SIM. |
| 20 | */ |
| 21 | private int getPackagePrivilegedStatus(@NonNull String pkgName, @NonNull Set<byte[]> certs) { |
| 22 | + // MAOS: companion to the isPackageMaybePrivileged grant above. SIM-equivalent |
| 23 | + // status keeps this package eligible as the carrier *service* (IMS socket bind) |
| 24 | + // as well as privileged (SIP delegate, GBA, UCE). |
| 25 | + if ("com.vayunmathur.communicate".equals(pkgName)) { |
| 26 | + return PACKAGE_PRIVILEGED_FROM_SIM; |
| 27 | + } |
| 28 | // Double-nested for loops, but each collection should contain at most 2 elements in nearly |
| 29 | // every case. |
| 30 | // TODO(b/184382310) find a way to speed this up |
| 31 | diff --git a/src/java/com/android/internal/telephony/uicc/UiccCarrierPrivilegeRules.java b/src/java/com/android/internal/telephony/uicc/UiccCarrierPrivilegeRules.java |
| 32 | index 66ac2cbaa1..e892890fe1 100644 |
| 33 | --- a/src/java/com/android/internal/telephony/uicc/UiccCarrierPrivilegeRules.java |
| 34 | +++ b/src/java/com/android/internal/telephony/uicc/UiccCarrierPrivilegeRules.java |
| 35 | @@ -361,6 +361,15 @@ public class UiccCarrierPrivilegeRules extends Handler { |
| 36 | return accessStatus; |
| 37 | } |
| 38 | } |
| 39 | + // MAOS: grant carrier privileges to the bundled Communicate app |
| 40 | + // (com.vayunmathur.communicate) regardless of UICC access rules, so |
| 41 | + // single-registration RCS works on carriers whose profiles carry no |
| 42 | + // rules (e.g. Jibe-backed MVNOs). Real UICC grants still take |
| 43 | + // precedence - this only fires when they say NO_ACCESS. |
| 44 | + if (packageInfo != null |
| 45 | + && "com.vayunmathur.communicate".equals(packageInfo.packageName)) { |
| 46 | + return TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS; |
| 47 | + } |
| 48 | return TelephonyManager.CARRIER_PRIVILEGE_STATUS_NO_ACCESS; |
| 49 | } |
| 50 |