diff options
Diffstat (limited to 'telephony')
-rwxr-xr-x[-rw-r--r--] | telephony/java/android/telephony/SubscriptionManager.java | 53 | ||||
-rwxr-xr-x | telephony/java/com/android/internal/telephony/ISub.aidl | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | telephony/java/com/android/internal/telephony/PhoneConstants.java | 3 |
3 files changed, 63 insertions, 1 deletions
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 32b7383..719af50 100644..100755 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -121,6 +121,16 @@ public class SubscriptionManager { public static final int SIM_NOT_INSERTED = -1; /** + * The activation state of SIM/sub. + * <P>Type: INTEGER (int)</P> + */ + public static final String SUB_STATE = "sub_state"; + + public static final int INACTIVE = 0; + public static final int ACTIVE = 1; + public static final int SUB_CONFIGURATION_IN_PROGRESS = 2; + + /** * TelephonyProvider column name for user displayed name. * <P>Type: TEXT (String)</P> */ @@ -1117,6 +1127,49 @@ public class SubscriptionManager { return phoneId >= 0 && phoneId < TelephonyManager.getDefault().getPhoneCount(); } + public static void activateSubId(int subId) { + logd("activateSubId sub id = " + subId); + try { + getISubInfo().activateSubId(subId); + } catch (RemoteException ex) { + return; + } + } + + public static void deactivateSubId(int subId) { + logd("deactivateSubId sub id = " + subId); + try { + getISubInfo().deactivateSubId(subId); + } catch (RemoteException ex) { + return; + } + } + + public static int getSubState(int subId) { + logd("getSubState sub id = " + subId); + try { + return getISubInfo().getSubState(subId); + } catch (RemoteException ex) { + return INACTIVE; + } + } + + public static int setSubState(int subId, int subState) { + logd("setSubState sub id = " + subId + " state = " + subState); + try { + return getISubInfo().setSubState(subId, subState); + } catch (RemoteException ex) { + return INACTIVE; + } + } + + /** + @hide + */ + private static ISub getISubInfo() { + return ISub.Stub.asInterface(ServiceManager.getService("isub")); + } + /** @hide */ public static void putPhoneIdAndSubIdExtra(Intent intent, int phoneId) { int[] subIds = SubscriptionManager.getSubId(phoneId); diff --git a/telephony/java/com/android/internal/telephony/ISub.aidl b/telephony/java/com/android/internal/telephony/ISub.aidl index f6aef08..1323258 100755 --- a/telephony/java/com/android/internal/telephony/ISub.aidl +++ b/telephony/java/com/android/internal/telephony/ISub.aidl @@ -183,4 +183,12 @@ interface ISub { int getSimStateForSlotIdx(int slotIdx); boolean isActiveSubId(int subId); + + void activateSubId(int subId); + + void deactivateSubId(int subId); + + int setSubState(int subId, int subStatus); + + int getSubState(int subId); } diff --git a/telephony/java/com/android/internal/telephony/PhoneConstants.java b/telephony/java/com/android/internal/telephony/PhoneConstants.java index 572cc6f..5fd7d5e 100644..100755 --- a/telephony/java/com/android/internal/telephony/PhoneConstants.java +++ b/telephony/java/com/android/internal/telephony/PhoneConstants.java @@ -183,7 +183,8 @@ public class PhoneConstants { public enum CardUnavailableReason { REASON_CARD_REMOVED, REASON_RADIO_UNAVAILABLE, - REASON_SIM_REFRESH_RESET + REASON_SIM_REFRESH_RESET, + REASON_APM_SIM_POWER_DOWN }; // Initial MTU value. |