Remove SHELL UID permission check from overrideConfig
Calling adoptShellPermissionIdentity does not cause
Binder#getCallingUid to return SHELL UID. Remove
this restriction and only check MODIFY_PHONE_STATE
until a better pattern can be established.
Bug: 131185660
Test: Manual
Merged-In: I292ce3117d1f95d83398b5685063254d21449bab
Change-Id: Ife2b3bbec6253add3a38a62d55be16a3c1b92dee
diff --git a/src/com/android/phone/CarrierConfigLoader.java b/src/com/android/phone/CarrierConfigLoader.java
index 1c4b1c3..8299d86 100644
--- a/src/com/android/phone/CarrierConfigLoader.java
+++ b/src/com/android/phone/CarrierConfigLoader.java
@@ -924,12 +924,9 @@
@Override
public void overrideConfig(int subscriptionId, PersistableBundle overrides) {
- // SHELL UID already has MODIFY_PHONE_STATE implicitly so we do not have to check it, but
- // the API signature explicitly declares that the method caller have MODIFY_PHONE_STATE, so
- // calling this as well to be safe.
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.MODIFY_PHONE_STATE, null);
- TelephonyPermissions.enforceShellOnly(Binder.getCallingUid(), "overrideConfig");
+ //TODO: Also check for SHELL UID to restrict this method to testing only (b/131326259)
int phoneId = SubscriptionManager.getPhoneId(subscriptionId);
if (!SubscriptionManager.isValidPhoneId(phoneId)) {
log("Ignore invalid phoneId: " + phoneId + " for subId: " + subscriptionId);