Merge "Add telephony API to switch multi sim config" am: 416e09ea27
am: 79d604f77e

Change-Id: Ib4015254390b4d2f138c970f028f4f3b7194aa99
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 7ff5ea3..ea85aea 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -6505,4 +6505,33 @@
             Binder.restoreCallingIdentity(identity);
         }
     }
+
+    /**
+     * Switch configs to enable multi-sim or switch back to single-sim
+     * @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");
+        final long identity = Binder.clearCallingIdentity();
+        try {
+            mPhoneConfigurationManager.switchMultiSimConfig(numOfSims);
+        } finally {
+            Binder.restoreCallingIdentity(identity);
+        }
+    }
+
+    /**
+     * Get how many sims have been activated on the phone
+     */
+    @Override
+    public int getNumOfActiveSims() {
+        final long identity = Binder.clearCallingIdentity();
+        try {
+            return mPhoneConfigurationManager.getNumOfActiveSims();
+        } finally {
+            Binder.restoreCallingIdentity(identity);
+        }
+    }
 }