diff options
Diffstat (limited to 'telephony/java/android/telephony/SubscriptionManager.java')
-rwxr-xr-x[-rw-r--r--] | telephony/java/android/telephony/SubscriptionManager.java | 53 |
1 files changed, 53 insertions, 0 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); |