Loading api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -37595,6 +37595,7 @@ package android.telephony { public class TelephonyManager { method public boolean canChangeDtmfToneLength(); method public android.telephony.TelephonyManager createForPhoneAccountHandle(android.telecom.PhoneAccountHandle); method public android.telephony.TelephonyManager createForSubscriptionId(int); method public java.util.List<android.telephony.CellInfo> getAllCellInfo(); method public int getCallState(); Loading @@ -37617,6 +37618,7 @@ package android.telephony { method public int getNetworkType(); method public int getPhoneCount(); method public int getPhoneType(); method public android.telephony.ServiceState getServiceState(); method public java.lang.String getSimCountryIso(); method public java.lang.String getSimOperator(); method public java.lang.String getSimOperatorName(); api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -40697,6 +40697,7 @@ package android.telephony { method public boolean canChangeDtmfToneLength(); method public int checkCarrierPrivilegesForPackage(java.lang.String); method public int checkCarrierPrivilegesForPackageAnyPhone(java.lang.String); method public android.telephony.TelephonyManager createForPhoneAccountHandle(android.telecom.PhoneAccountHandle); method public android.telephony.TelephonyManager createForSubscriptionId(int); method public void dial(java.lang.String); method public boolean disableDataConnectivity(); Loading Loading @@ -40734,6 +40735,7 @@ package android.telephony { method public int getNetworkType(); method public int getPhoneCount(); method public int getPhoneType(); method public android.telephony.ServiceState getServiceState(); method public java.lang.String getSimCountryIso(); method public java.lang.String getSimOperator(); method public java.lang.String getSimOperatorName(); api/test-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -37685,6 +37685,7 @@ package android.telephony { public class TelephonyManager { method public boolean canChangeDtmfToneLength(); method public android.telephony.TelephonyManager createForPhoneAccountHandle(android.telecom.PhoneAccountHandle); method public android.telephony.TelephonyManager createForSubscriptionId(int); method public java.util.List<android.telephony.CellInfo> getAllCellInfo(); method public int getCallState(); Loading @@ -37707,6 +37708,7 @@ package android.telephony { method public int getNetworkType(); method public int getPhoneCount(); method public int getPhoneType(); method public android.telephony.ServiceState getServiceState(); method public java.lang.String getSimCountryIso(); method public java.lang.String getSimOperator(); method public java.lang.String getSimOperatorName(); telephony/java/android/telephony/PhoneStateListener.java +5 −5 Original line number Diff line number Diff line Loading @@ -233,7 +233,7 @@ public class PhoneStateListener { * @hide */ /** @hide */ protected int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; protected Integer mSubId; private final Handler mHandler; Loading @@ -242,7 +242,7 @@ public class PhoneStateListener { * This class requires Looper.myLooper() not return null. */ public PhoneStateListener() { this(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, Looper.myLooper()); this(null, Looper.myLooper()); } /** Loading @@ -251,7 +251,7 @@ public class PhoneStateListener { * @hide */ public PhoneStateListener(Looper looper) { this(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, looper); this(null, looper); } /** Loading @@ -260,7 +260,7 @@ public class PhoneStateListener { * own non-null Looper use PhoneStateListener(int subId, Looper looper) below. * @hide */ public PhoneStateListener(int subId) { public PhoneStateListener(Integer subId) { this(subId, Looper.myLooper()); } Loading @@ -269,7 +269,7 @@ public class PhoneStateListener { * and non-null Looper. * @hide */ public PhoneStateListener(int subId, Looper looper) { public PhoneStateListener(Integer subId, Looper looper) { if (DBG) log("ctor: subId=" + subId + " looper=" + looper); mSubId = subId; mHandler = new Handler(looper) { Loading telephony/java/android/telephony/TelephonyManager.java +45 −0 Original line number Diff line number Diff line Loading @@ -263,6 +263,22 @@ public class TelephonyManager { return new TelephonyManager(mContext, subId); } /** * Create a new TelephonyManager object pinned to the subscription ID associated with the given * phone account. * * @return a TelephonyManager that uses the given phone account for all calls, or {@code null} * if the phone account does not correspond to a valid subscription ID. */ @Nullable public TelephonyManager createForPhoneAccountHandle(PhoneAccountHandle phoneAccountHandle) { int subId = getSubIdForPhoneAccountHandle(phoneAccountHandle); if (!SubscriptionManager.isValidSubscriptionId(subId)) { return null; } return new TelephonyManager(mContext, subId); } /** {@hide} */ public boolean isMultiSimEnabled() { return (multiSimConfig.equals("dsds") || multiSimConfig.equals("dsda") || Loading Loading @@ -3019,6 +3035,12 @@ public class TelephonyManager { if (mContext == null) return; try { Boolean notifyNow = (getITelephony() != null); // If the listener has not explicitly set the subId (for example, created with the // default constructor), replace the subId so it will listen to the account the // telephony manager is created with. if (listener.mSubId == null) { listener.mSubId = mSubId; } sRegistry.listenForSubscriber(listener.mSubId, getOpPackageName(), listener.callback, events, notifyNow); } catch (RemoteException ex) { Loading Loading @@ -5446,6 +5468,19 @@ public class TelephonyManager { return retval; } private int getSubIdForPhoneAccountHandle(PhoneAccountHandle phoneAccountHandle) { int retval = SubscriptionManager.INVALID_SUBSCRIPTION_ID; try { ITelecomService service = getTelecomService(); if (service != null) { retval = getSubIdForPhoneAccount(service.getPhoneAccount(phoneAccountHandle)); } } catch (RemoteException e) { } return retval; } /** * Resets telephony manager settings back to factory defaults. * Loading Loading @@ -5494,6 +5529,16 @@ public class TelephonyManager { result.send(0, null); } /** * Returns the current {@link ServiceState} information. * * <p>Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} */ public ServiceState getServiceState() { return getServiceStateForSubscriber(getSubId()); } /** * Returns the service state information on specified subscription. Callers require * either READ_PRIVILEGED_PHONE_STATE or READ_PHONE_STATE to retrieve the information. Loading Loading
api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -37595,6 +37595,7 @@ package android.telephony { public class TelephonyManager { method public boolean canChangeDtmfToneLength(); method public android.telephony.TelephonyManager createForPhoneAccountHandle(android.telecom.PhoneAccountHandle); method public android.telephony.TelephonyManager createForSubscriptionId(int); method public java.util.List<android.telephony.CellInfo> getAllCellInfo(); method public int getCallState(); Loading @@ -37617,6 +37618,7 @@ package android.telephony { method public int getNetworkType(); method public int getPhoneCount(); method public int getPhoneType(); method public android.telephony.ServiceState getServiceState(); method public java.lang.String getSimCountryIso(); method public java.lang.String getSimOperator(); method public java.lang.String getSimOperatorName();
api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -40697,6 +40697,7 @@ package android.telephony { method public boolean canChangeDtmfToneLength(); method public int checkCarrierPrivilegesForPackage(java.lang.String); method public int checkCarrierPrivilegesForPackageAnyPhone(java.lang.String); method public android.telephony.TelephonyManager createForPhoneAccountHandle(android.telecom.PhoneAccountHandle); method public android.telephony.TelephonyManager createForSubscriptionId(int); method public void dial(java.lang.String); method public boolean disableDataConnectivity(); Loading Loading @@ -40734,6 +40735,7 @@ package android.telephony { method public int getNetworkType(); method public int getPhoneCount(); method public int getPhoneType(); method public android.telephony.ServiceState getServiceState(); method public java.lang.String getSimCountryIso(); method public java.lang.String getSimOperator(); method public java.lang.String getSimOperatorName();
api/test-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -37685,6 +37685,7 @@ package android.telephony { public class TelephonyManager { method public boolean canChangeDtmfToneLength(); method public android.telephony.TelephonyManager createForPhoneAccountHandle(android.telecom.PhoneAccountHandle); method public android.telephony.TelephonyManager createForSubscriptionId(int); method public java.util.List<android.telephony.CellInfo> getAllCellInfo(); method public int getCallState(); Loading @@ -37707,6 +37708,7 @@ package android.telephony { method public int getNetworkType(); method public int getPhoneCount(); method public int getPhoneType(); method public android.telephony.ServiceState getServiceState(); method public java.lang.String getSimCountryIso(); method public java.lang.String getSimOperator(); method public java.lang.String getSimOperatorName();
telephony/java/android/telephony/PhoneStateListener.java +5 −5 Original line number Diff line number Diff line Loading @@ -233,7 +233,7 @@ public class PhoneStateListener { * @hide */ /** @hide */ protected int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; protected Integer mSubId; private final Handler mHandler; Loading @@ -242,7 +242,7 @@ public class PhoneStateListener { * This class requires Looper.myLooper() not return null. */ public PhoneStateListener() { this(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, Looper.myLooper()); this(null, Looper.myLooper()); } /** Loading @@ -251,7 +251,7 @@ public class PhoneStateListener { * @hide */ public PhoneStateListener(Looper looper) { this(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, looper); this(null, looper); } /** Loading @@ -260,7 +260,7 @@ public class PhoneStateListener { * own non-null Looper use PhoneStateListener(int subId, Looper looper) below. * @hide */ public PhoneStateListener(int subId) { public PhoneStateListener(Integer subId) { this(subId, Looper.myLooper()); } Loading @@ -269,7 +269,7 @@ public class PhoneStateListener { * and non-null Looper. * @hide */ public PhoneStateListener(int subId, Looper looper) { public PhoneStateListener(Integer subId, Looper looper) { if (DBG) log("ctor: subId=" + subId + " looper=" + looper); mSubId = subId; mHandler = new Handler(looper) { Loading
telephony/java/android/telephony/TelephonyManager.java +45 −0 Original line number Diff line number Diff line Loading @@ -263,6 +263,22 @@ public class TelephonyManager { return new TelephonyManager(mContext, subId); } /** * Create a new TelephonyManager object pinned to the subscription ID associated with the given * phone account. * * @return a TelephonyManager that uses the given phone account for all calls, or {@code null} * if the phone account does not correspond to a valid subscription ID. */ @Nullable public TelephonyManager createForPhoneAccountHandle(PhoneAccountHandle phoneAccountHandle) { int subId = getSubIdForPhoneAccountHandle(phoneAccountHandle); if (!SubscriptionManager.isValidSubscriptionId(subId)) { return null; } return new TelephonyManager(mContext, subId); } /** {@hide} */ public boolean isMultiSimEnabled() { return (multiSimConfig.equals("dsds") || multiSimConfig.equals("dsda") || Loading Loading @@ -3019,6 +3035,12 @@ public class TelephonyManager { if (mContext == null) return; try { Boolean notifyNow = (getITelephony() != null); // If the listener has not explicitly set the subId (for example, created with the // default constructor), replace the subId so it will listen to the account the // telephony manager is created with. if (listener.mSubId == null) { listener.mSubId = mSubId; } sRegistry.listenForSubscriber(listener.mSubId, getOpPackageName(), listener.callback, events, notifyNow); } catch (RemoteException ex) { Loading Loading @@ -5446,6 +5468,19 @@ public class TelephonyManager { return retval; } private int getSubIdForPhoneAccountHandle(PhoneAccountHandle phoneAccountHandle) { int retval = SubscriptionManager.INVALID_SUBSCRIPTION_ID; try { ITelecomService service = getTelecomService(); if (service != null) { retval = getSubIdForPhoneAccount(service.getPhoneAccount(phoneAccountHandle)); } } catch (RemoteException e) { } return retval; } /** * Resets telephony manager settings back to factory defaults. * Loading Loading @@ -5494,6 +5529,16 @@ public class TelephonyManager { result.send(0, null); } /** * Returns the current {@link ServiceState} information. * * <p>Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} */ public ServiceState getServiceState() { return getServiceStateForSubscriber(getSubId()); } /** * Returns the service state information on specified subscription. Callers require * either READ_PRIVILEGED_PHONE_STATE or READ_PHONE_STATE to retrieve the information. Loading