Merge "disallow changing from multi-sim to single-sim for carrier apps"
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 8bc8ce0..fd484f0 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -6616,12 +6616,19 @@
/**
* Switch configs to enable multi-sim or switch back to single-sim
+ * Note: Switch from multi-sim to single-sim is only possible with MODIFY_PHONE_STATE
+ * permission, but the other way around is possible with either MODIFY_PHONE_STATE
+ * or carrier privileges
* @param numOfSims number of active sims we want to switch to
*/
@Override
public void switchMultiSimConfig(int numOfSims) {
- TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege(
- mApp, SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, "switchMultiSimConfig");
+ if (numOfSims == 1) {
+ enforceModifyPermission();
+ } else {
+ TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege(
+ mApp, SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, "switchMultiSimConfig");
+ }
final long identity = Binder.clearCallingIdentity();
try {