Loading telephony/java/android/telephony/TelephonyManager.java +38 −0 Original line number Diff line number Diff line Loading @@ -5521,6 +5521,44 @@ public class TelephonyManager { TelephonyProperties.PROPERTY_SIM_STATE, state); } /** * Set SIM card power state. Request is equivalent to inserting or removing the card. * * @param powerUp True if powering up the SIM, otherwise powering down * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} * * @hide **/ public void setSimPowerState(boolean powerUp) { setSimPowerStateForSlot(getDefaultSim(), powerUp); } /** * 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 * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} * * @hide **/ public void setSimPowerStateForSlot(int slotId, boolean powerUp) { try { ITelephony telephony = getITelephony(); if (telephony != null) { telephony.setSimPowerStateForSlot(slotId, powerUp); } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#setSimPowerStateForSlot", e); } catch (SecurityException e) { Log.e(TAG, "Permission error calling ITelephony#setSimPowerStateForSlot", e); } } /** * Set baseband version for the default phone. * Loading telephony/java/com/android/internal/telephony/ITelephony.aidl +8 −0 Original line number Diff line number Diff line Loading @@ -1287,4 +1287,12 @@ interface ITelephony { * @hide */ List<ClientRequestStats> getClientRequestStats(String callingPackage, int subid); /** * 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 * @hide * */ void setSimPowerStateForSlot(int slotId, boolean powerUp); } Loading
telephony/java/android/telephony/TelephonyManager.java +38 −0 Original line number Diff line number Diff line Loading @@ -5521,6 +5521,44 @@ public class TelephonyManager { TelephonyProperties.PROPERTY_SIM_STATE, state); } /** * Set SIM card power state. Request is equivalent to inserting or removing the card. * * @param powerUp True if powering up the SIM, otherwise powering down * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} * * @hide **/ public void setSimPowerState(boolean powerUp) { setSimPowerStateForSlot(getDefaultSim(), powerUp); } /** * 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 * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} * * @hide **/ public void setSimPowerStateForSlot(int slotId, boolean powerUp) { try { ITelephony telephony = getITelephony(); if (telephony != null) { telephony.setSimPowerStateForSlot(slotId, powerUp); } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#setSimPowerStateForSlot", e); } catch (SecurityException e) { Log.e(TAG, "Permission error calling ITelephony#setSimPowerStateForSlot", e); } } /** * Set baseband version for the default phone. * Loading
telephony/java/com/android/internal/telephony/ITelephony.aidl +8 −0 Original line number Diff line number Diff line Loading @@ -1287,4 +1287,12 @@ interface ITelephony { * @hide */ List<ClientRequestStats> getClientRequestStats(String callingPackage, int subid); /** * 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 * @hide * */ void setSimPowerStateForSlot(int slotId, boolean powerUp); }