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
Change-Id: Ibb14162c55d08982d9b288fc9b2e96c4c9de05d9
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index d66f219..82a67dd 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -3706,4 +3706,20 @@
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();
+ Phone phone = PhoneFactory.getPhone(slotId);
+ if (phone != null) {
+ phone.setSimPowerState(powerUp);
+ }
+ }
}