Added telephony manager set sim power state API

The new API can be used to power up/down the SIM. This is equivalent
to inserting and removing the card.

Test: Telephony sanity tests
bug: 32224755

Merged-In: Ibb14162c55d08982d9b288fc9b2e96c4c9de05d9
Change-Id: Ibb14162c55d08982d9b288fc9b2e96c4c9de05d9
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 75c6d87..c8b609a 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -3504,4 +3504,25 @@
         workSource = new WorkSource(uid, packageName);
         return workSource;
     }
+
+    /**
+     * Set SIM card power state. Request is equivalent to inserting or removing the card.
+     *
+     * @param slotId SIM slot id.
+     * @param powerUp True if powering up the SIM, otherwise powering down
+     *
+     **/
+    @Override
+    public void setSimPowerStateForSlot(int slotId, boolean powerUp) {
+        enforceModifyPermission();
+        int subId[] = mSubscriptionController.getSubIdUsingSlotId(slotId);
+        if (subId == null || subId.length == 0) {
+            return;
+        }
+
+        final Phone phone = getPhone(subId[0]);
+        if (phone != null) {
+            phone.setSimPowerState(powerUp);
+        }
+    }
 }