Merge "Change how TelephonyManager handles subscriptions." into nyc-dev

This commit is contained in:
Jonathan Basseri
2016-05-26 15:50:03 +00:00
committed by Android (Google) Code Review
4 changed files with 126 additions and 139 deletions

View File

@@ -37203,69 +37203,47 @@ package android.telephony {
public class TelephonyManager { public class TelephonyManager {
method public boolean canChangeDtmfToneLength(); method public boolean canChangeDtmfToneLength();
method public android.telephony.TelephonyManager createForSubscriptionId(int);
method public java.util.List<android.telephony.CellInfo> getAllCellInfo(); method public java.util.List<android.telephony.CellInfo> getAllCellInfo();
method public int getCallState(); method public int getCallState();
method public int getCallState(int);
method public android.telephony.CellLocation getCellLocation(); method public android.telephony.CellLocation getCellLocation();
method public int getDataActivity(); method public int getDataActivity();
method public int getDataNetworkType(int); method public int getDataNetworkType();
method public int getDataState(); method public int getDataState();
method public java.lang.String getDeviceId(); method public java.lang.String getDeviceId();
method public java.lang.String getDeviceId(int); method public java.lang.String getDeviceId(int);
method public java.lang.String getDeviceSoftwareVersion(); method public java.lang.String getDeviceSoftwareVersion();
method public java.lang.String getGroupIdLevel1(); method public java.lang.String getGroupIdLevel1();
method public java.lang.String getGroupIdLevel1(int);
method public java.lang.String getIccAuthentication(int, int, java.lang.String); method public java.lang.String getIccAuthentication(int, int, java.lang.String);
method public java.lang.String getIccAuthentication(int, int, int, java.lang.String);
method public java.lang.String getLine1AlphaTag(int);
method public java.lang.String getLine1Number(); method public java.lang.String getLine1Number();
method public java.lang.String getLine1Number(int);
method public java.lang.String getMmsUAProfUrl(); method public java.lang.String getMmsUAProfUrl();
method public java.lang.String getMmsUserAgent(); method public java.lang.String getMmsUserAgent();
method public deprecated java.util.List<android.telephony.NeighboringCellInfo> getNeighboringCellInfo(); method public deprecated java.util.List<android.telephony.NeighboringCellInfo> getNeighboringCellInfo();
method public java.lang.String getNetworkCountryIso(); method public java.lang.String getNetworkCountryIso();
method public java.lang.String getNetworkCountryIso(int);
method public java.lang.String getNetworkOperator(); method public java.lang.String getNetworkOperator();
method public java.lang.String getNetworkOperator(int);
method public java.lang.String getNetworkOperatorName(); method public java.lang.String getNetworkOperatorName();
method public java.lang.String getNetworkOperatorName(int);
method public int getNetworkType(); method public int getNetworkType();
method public int getNetworkType(int);
method public int getPhoneCount(); method public int getPhoneCount();
method public int getPhoneType(); method public int getPhoneType();
method public java.lang.String getSimCountryIso(); method public java.lang.String getSimCountryIso();
method public java.lang.String getSimCountryIso(int);
method public java.lang.String getSimOperator(); method public java.lang.String getSimOperator();
method public java.lang.String getSimOperator(int);
method public java.lang.String getSimOperatorName(); method public java.lang.String getSimOperatorName();
method public java.lang.String getSimOperatorName(int);
method public java.lang.String getSimSerialNumber(); method public java.lang.String getSimSerialNumber();
method public java.lang.String getSimSerialNumber(int);
method public int getSimState(); method public int getSimState();
method public java.lang.String getSubscriberId(); method public java.lang.String getSubscriberId();
method public java.lang.String getSubscriberId(int);
method public java.lang.String getVoiceMailAlphaTag(); method public java.lang.String getVoiceMailAlphaTag();
method public java.lang.String getVoiceMailAlphaTag(int);
method public java.lang.String getVoiceMailNumber(); method public java.lang.String getVoiceMailNumber();
method public java.lang.String getVoiceMailNumber(int); method public int getVoiceNetworkType();
method public int getVoiceNetworkType(int);
method public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle); method public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle);
method public boolean hasCarrierPrivileges(); method public boolean hasCarrierPrivileges();
method public boolean hasCarrierPrivileges(int);
method public boolean hasIccCard(); method public boolean hasIccCard();
method public boolean iccCloseLogicalChannel(int); method public boolean iccCloseLogicalChannel(int);
method public boolean iccCloseLogicalChannel(int, int);
method public byte[] iccExchangeSimIO(int, int, int, int, int, java.lang.String); method public byte[] iccExchangeSimIO(int, int, int, int, int, java.lang.String);
method public byte[] iccExchangeSimIO(int, int, int, int, int, int, java.lang.String);
method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String); method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String);
method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(int, java.lang.String);
method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, java.lang.String); method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, java.lang.String);
method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, int, java.lang.String);
method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, java.lang.String); method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, java.lang.String);
method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, int, java.lang.String);
method public boolean isHearingAidCompatibilitySupported(); method public boolean isHearingAidCompatibilitySupported();
method public boolean isNetworkRoaming(); method public boolean isNetworkRoaming();
method public boolean isNetworkRoaming(int);
method public boolean isSmsCapable(); method public boolean isSmsCapable();
method public boolean isTtyModeSupported(); method public boolean isTtyModeSupported();
method public boolean isVoiceCapable(); method public boolean isVoiceCapable();
@@ -37273,15 +37251,10 @@ package android.telephony {
method public boolean isWorldPhone(); method public boolean isWorldPhone();
method public void listen(android.telephony.PhoneStateListener, int); method public void listen(android.telephony.PhoneStateListener, int);
method public java.lang.String sendEnvelopeWithStatus(java.lang.String); method public java.lang.String sendEnvelopeWithStatus(java.lang.String);
method public java.lang.String sendEnvelopeWithStatus(int, java.lang.String);
method public boolean setLine1NumberForDisplay(java.lang.String, java.lang.String); method public boolean setLine1NumberForDisplay(java.lang.String, java.lang.String);
method public boolean setLine1NumberForDisplay(int, java.lang.String, java.lang.String);
method public boolean setOperatorBrandOverride(java.lang.String); method public boolean setOperatorBrandOverride(java.lang.String);
method public boolean setOperatorBrandOverride(int, java.lang.String);
method public boolean setPreferredNetworkTypeToGlobal(); method public boolean setPreferredNetworkTypeToGlobal();
method public boolean setPreferredNetworkTypeToGlobal(int);
method public boolean setVoiceMailNumber(java.lang.String, java.lang.String); method public boolean setVoiceMailNumber(java.lang.String, java.lang.String);
method public boolean setVoiceMailNumber(int, java.lang.String, java.lang.String);
field public static final java.lang.String ACTION_CONFIGURE_VOICEMAIL = "android.telephony.action.CONFIGURE_VOICEMAIL"; field public static final java.lang.String ACTION_CONFIGURE_VOICEMAIL = "android.telephony.action.CONFIGURE_VOICEMAIL";
field public static final java.lang.String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE"; field public static final java.lang.String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE";
field public static final java.lang.String ACTION_RESPOND_VIA_MESSAGE = "android.intent.action.RESPOND_VIA_MESSAGE"; field public static final java.lang.String ACTION_RESPOND_VIA_MESSAGE = "android.intent.action.RESPOND_VIA_MESSAGE";

View File

@@ -40140,6 +40140,7 @@ package android.telephony {
method public boolean canChangeDtmfToneLength(); method public boolean canChangeDtmfToneLength();
method public int checkCarrierPrivilegesForPackage(java.lang.String); method public int checkCarrierPrivilegesForPackage(java.lang.String);
method public int checkCarrierPrivilegesForPackageAnyPhone(java.lang.String); method public int checkCarrierPrivilegesForPackageAnyPhone(java.lang.String);
method public android.telephony.TelephonyManager createForSubscriptionId(int);
method public void dial(java.lang.String); method public void dial(java.lang.String);
method public boolean disableDataConnectivity(); method public boolean disableDataConnectivity();
method public boolean enableDataConnectivity(); method public boolean enableDataConnectivity();
@@ -40147,7 +40148,6 @@ package android.telephony {
method public boolean endCall(); method public boolean endCall();
method public java.util.List<android.telephony.CellInfo> getAllCellInfo(); method public java.util.List<android.telephony.CellInfo> getAllCellInfo();
method public int getCallState(); method public int getCallState();
method public int getCallState(int);
method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent); method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent);
method public java.util.List<java.lang.String> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int); method public java.util.List<java.lang.String> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int);
method public java.lang.String getCdmaMdn(); method public java.lang.String getCdmaMdn();
@@ -40160,68 +40160,46 @@ package android.telephony {
method public int getDataActivity(); method public int getDataActivity();
method public boolean getDataEnabled(); method public boolean getDataEnabled();
method public boolean getDataEnabled(int); method public boolean getDataEnabled(int);
method public int getDataNetworkType(int); method public int getDataNetworkType();
method public int getDataState(); method public int getDataState();
method public java.lang.String getDeviceId(); method public java.lang.String getDeviceId();
method public java.lang.String getDeviceId(int); method public java.lang.String getDeviceId(int);
method public java.lang.String getDeviceSoftwareVersion(); method public java.lang.String getDeviceSoftwareVersion();
method public java.lang.String getGroupIdLevel1(); method public java.lang.String getGroupIdLevel1();
method public java.lang.String getGroupIdLevel1(int);
method public java.lang.String getIccAuthentication(int, int, java.lang.String); method public java.lang.String getIccAuthentication(int, int, java.lang.String);
method public java.lang.String getIccAuthentication(int, int, int, java.lang.String);
method public java.lang.String getLine1AlphaTag(int);
method public java.lang.String getLine1Number(); method public java.lang.String getLine1Number();
method public java.lang.String getLine1Number(int);
method public java.lang.String getMmsUAProfUrl(); method public java.lang.String getMmsUAProfUrl();
method public java.lang.String getMmsUserAgent(); method public java.lang.String getMmsUserAgent();
method public deprecated java.util.List<android.telephony.NeighboringCellInfo> getNeighboringCellInfo(); method public deprecated java.util.List<android.telephony.NeighboringCellInfo> getNeighboringCellInfo();
method public java.lang.String getNetworkCountryIso(); method public java.lang.String getNetworkCountryIso();
method public java.lang.String getNetworkCountryIso(int);
method public java.lang.String getNetworkOperator(); method public java.lang.String getNetworkOperator();
method public java.lang.String getNetworkOperator(int);
method public java.lang.String getNetworkOperatorName(); method public java.lang.String getNetworkOperatorName();
method public java.lang.String getNetworkOperatorName(int);
method public int getNetworkType(); method public int getNetworkType();
method public int getNetworkType(int);
method public int getPhoneCount(); method public int getPhoneCount();
method public int getPhoneType(); method public int getPhoneType();
method public java.lang.String getSimCountryIso(); method public java.lang.String getSimCountryIso();
method public java.lang.String getSimCountryIso(int);
method public java.lang.String getSimOperator(); method public java.lang.String getSimOperator();
method public java.lang.String getSimOperator(int);
method public java.lang.String getSimOperatorName(); method public java.lang.String getSimOperatorName();
method public java.lang.String getSimOperatorName(int);
method public java.lang.String getSimSerialNumber(); method public java.lang.String getSimSerialNumber();
method public java.lang.String getSimSerialNumber(int);
method public int getSimState(); method public int getSimState();
method public java.lang.String getSubscriberId(); method public java.lang.String getSubscriberId();
method public java.lang.String getSubscriberId(int);
method public java.lang.String getVoiceMailAlphaTag(); method public java.lang.String getVoiceMailAlphaTag();
method public java.lang.String getVoiceMailAlphaTag(int);
method public java.lang.String getVoiceMailNumber(); method public java.lang.String getVoiceMailNumber();
method public java.lang.String getVoiceMailNumber(int); method public int getVoiceNetworkType();
method public int getVoiceNetworkType(int);
method public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle); method public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle);
method public boolean handlePinMmi(java.lang.String); method public boolean handlePinMmi(java.lang.String);
method public boolean handlePinMmiForSubscriber(int, java.lang.String); method public boolean handlePinMmiForSubscriber(int, java.lang.String);
method public boolean hasCarrierPrivileges(); method public boolean hasCarrierPrivileges();
method public boolean hasCarrierPrivileges(int);
method public boolean hasIccCard(); method public boolean hasIccCard();
method public boolean iccCloseLogicalChannel(int); method public boolean iccCloseLogicalChannel(int);
method public boolean iccCloseLogicalChannel(int, int);
method public byte[] iccExchangeSimIO(int, int, int, int, int, java.lang.String); method public byte[] iccExchangeSimIO(int, int, int, int, int, java.lang.String);
method public byte[] iccExchangeSimIO(int, int, int, int, int, int, java.lang.String);
method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String); method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String);
method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(int, java.lang.String);
method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, java.lang.String); method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, java.lang.String);
method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, int, java.lang.String);
method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, java.lang.String); method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, java.lang.String);
method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, int, java.lang.String);
method public boolean isDataConnectivityPossible(); method public boolean isDataConnectivityPossible();
method public boolean isHearingAidCompatibilitySupported(); method public boolean isHearingAidCompatibilitySupported();
method public boolean isIdle(); method public boolean isIdle();
method public boolean isNetworkRoaming(); method public boolean isNetworkRoaming();
method public boolean isNetworkRoaming(int);
method public boolean isOffhook(); method public boolean isOffhook();
method public boolean isRadioOn(); method public boolean isRadioOn();
method public boolean isRinging(); method public boolean isRinging();
@@ -40234,19 +40212,14 @@ package android.telephony {
method public void listen(android.telephony.PhoneStateListener, int); method public void listen(android.telephony.PhoneStateListener, int);
method public boolean needsOtaServiceProvisioning(); method public boolean needsOtaServiceProvisioning();
method public java.lang.String sendEnvelopeWithStatus(java.lang.String); method public java.lang.String sendEnvelopeWithStatus(java.lang.String);
method public java.lang.String sendEnvelopeWithStatus(int, java.lang.String);
method public void setDataEnabled(boolean); method public void setDataEnabled(boolean);
method public void setDataEnabled(int, boolean); method public void setDataEnabled(int, boolean);
method public boolean setLine1NumberForDisplay(java.lang.String, java.lang.String); method public boolean setLine1NumberForDisplay(java.lang.String, java.lang.String);
method public boolean setLine1NumberForDisplay(int, java.lang.String, java.lang.String);
method public boolean setOperatorBrandOverride(java.lang.String); method public boolean setOperatorBrandOverride(java.lang.String);
method public boolean setOperatorBrandOverride(int, java.lang.String);
method public boolean setPreferredNetworkTypeToGlobal(); method public boolean setPreferredNetworkTypeToGlobal();
method public boolean setPreferredNetworkTypeToGlobal(int);
method public boolean setRadio(boolean); method public boolean setRadio(boolean);
method public boolean setRadioPower(boolean); method public boolean setRadioPower(boolean);
method public boolean setVoiceMailNumber(java.lang.String, java.lang.String); method public boolean setVoiceMailNumber(java.lang.String, java.lang.String);
method public boolean setVoiceMailNumber(int, java.lang.String, java.lang.String);
method public void silenceRinger(); method public void silenceRinger();
method public boolean supplyPin(java.lang.String); method public boolean supplyPin(java.lang.String);
method public int[] supplyPinReportResult(java.lang.String); method public int[] supplyPinReportResult(java.lang.String);

View File

@@ -37280,69 +37280,47 @@ package android.telephony {
public class TelephonyManager { public class TelephonyManager {
method public boolean canChangeDtmfToneLength(); method public boolean canChangeDtmfToneLength();
method public android.telephony.TelephonyManager createForSubscriptionId(int);
method public java.util.List<android.telephony.CellInfo> getAllCellInfo(); method public java.util.List<android.telephony.CellInfo> getAllCellInfo();
method public int getCallState(); method public int getCallState();
method public int getCallState(int);
method public android.telephony.CellLocation getCellLocation(); method public android.telephony.CellLocation getCellLocation();
method public int getDataActivity(); method public int getDataActivity();
method public int getDataNetworkType(int); method public int getDataNetworkType();
method public int getDataState(); method public int getDataState();
method public java.lang.String getDeviceId(); method public java.lang.String getDeviceId();
method public java.lang.String getDeviceId(int); method public java.lang.String getDeviceId(int);
method public java.lang.String getDeviceSoftwareVersion(); method public java.lang.String getDeviceSoftwareVersion();
method public java.lang.String getGroupIdLevel1(); method public java.lang.String getGroupIdLevel1();
method public java.lang.String getGroupIdLevel1(int);
method public java.lang.String getIccAuthentication(int, int, java.lang.String); method public java.lang.String getIccAuthentication(int, int, java.lang.String);
method public java.lang.String getIccAuthentication(int, int, int, java.lang.String);
method public java.lang.String getLine1AlphaTag(int);
method public java.lang.String getLine1Number(); method public java.lang.String getLine1Number();
method public java.lang.String getLine1Number(int);
method public java.lang.String getMmsUAProfUrl(); method public java.lang.String getMmsUAProfUrl();
method public java.lang.String getMmsUserAgent(); method public java.lang.String getMmsUserAgent();
method public deprecated java.util.List<android.telephony.NeighboringCellInfo> getNeighboringCellInfo(); method public deprecated java.util.List<android.telephony.NeighboringCellInfo> getNeighboringCellInfo();
method public java.lang.String getNetworkCountryIso(); method public java.lang.String getNetworkCountryIso();
method public java.lang.String getNetworkCountryIso(int);
method public java.lang.String getNetworkOperator(); method public java.lang.String getNetworkOperator();
method public java.lang.String getNetworkOperator(int);
method public java.lang.String getNetworkOperatorName(); method public java.lang.String getNetworkOperatorName();
method public java.lang.String getNetworkOperatorName(int);
method public int getNetworkType(); method public int getNetworkType();
method public int getNetworkType(int);
method public int getPhoneCount(); method public int getPhoneCount();
method public int getPhoneType(); method public int getPhoneType();
method public java.lang.String getSimCountryIso(); method public java.lang.String getSimCountryIso();
method public java.lang.String getSimCountryIso(int);
method public java.lang.String getSimOperator(); method public java.lang.String getSimOperator();
method public java.lang.String getSimOperator(int);
method public java.lang.String getSimOperatorName(); method public java.lang.String getSimOperatorName();
method public java.lang.String getSimOperatorName(int);
method public java.lang.String getSimSerialNumber(); method public java.lang.String getSimSerialNumber();
method public java.lang.String getSimSerialNumber(int);
method public int getSimState(); method public int getSimState();
method public java.lang.String getSubscriberId(); method public java.lang.String getSubscriberId();
method public java.lang.String getSubscriberId(int);
method public java.lang.String getVoiceMailAlphaTag(); method public java.lang.String getVoiceMailAlphaTag();
method public java.lang.String getVoiceMailAlphaTag(int);
method public java.lang.String getVoiceMailNumber(); method public java.lang.String getVoiceMailNumber();
method public java.lang.String getVoiceMailNumber(int); method public int getVoiceNetworkType();
method public int getVoiceNetworkType(int);
method public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle); method public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle);
method public boolean hasCarrierPrivileges(); method public boolean hasCarrierPrivileges();
method public boolean hasCarrierPrivileges(int);
method public boolean hasIccCard(); method public boolean hasIccCard();
method public boolean iccCloseLogicalChannel(int); method public boolean iccCloseLogicalChannel(int);
method public boolean iccCloseLogicalChannel(int, int);
method public byte[] iccExchangeSimIO(int, int, int, int, int, java.lang.String); method public byte[] iccExchangeSimIO(int, int, int, int, int, java.lang.String);
method public byte[] iccExchangeSimIO(int, int, int, int, int, int, java.lang.String);
method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String); method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String);
method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(int, java.lang.String);
method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, java.lang.String); method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, java.lang.String);
method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, int, java.lang.String);
method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, java.lang.String); method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, java.lang.String);
method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, int, java.lang.String);
method public boolean isHearingAidCompatibilitySupported(); method public boolean isHearingAidCompatibilitySupported();
method public boolean isNetworkRoaming(); method public boolean isNetworkRoaming();
method public boolean isNetworkRoaming(int);
method public boolean isSmsCapable(); method public boolean isSmsCapable();
method public boolean isTtyModeSupported(); method public boolean isTtyModeSupported();
method public boolean isVoiceCapable(); method public boolean isVoiceCapable();
@@ -37350,15 +37328,10 @@ package android.telephony {
method public boolean isWorldPhone(); method public boolean isWorldPhone();
method public void listen(android.telephony.PhoneStateListener, int); method public void listen(android.telephony.PhoneStateListener, int);
method public java.lang.String sendEnvelopeWithStatus(java.lang.String); method public java.lang.String sendEnvelopeWithStatus(java.lang.String);
method public java.lang.String sendEnvelopeWithStatus(int, java.lang.String);
method public boolean setLine1NumberForDisplay(java.lang.String, java.lang.String); method public boolean setLine1NumberForDisplay(java.lang.String, java.lang.String);
method public boolean setLine1NumberForDisplay(int, java.lang.String, java.lang.String);
method public boolean setOperatorBrandOverride(java.lang.String); method public boolean setOperatorBrandOverride(java.lang.String);
method public boolean setOperatorBrandOverride(int, java.lang.String);
method public boolean setPreferredNetworkTypeToGlobal(); method public boolean setPreferredNetworkTypeToGlobal();
method public boolean setPreferredNetworkTypeToGlobal(int);
method public boolean setVoiceMailNumber(java.lang.String, java.lang.String); method public boolean setVoiceMailNumber(java.lang.String, java.lang.String);
method public boolean setVoiceMailNumber(int, java.lang.String, java.lang.String);
field public static final java.lang.String ACTION_CONFIGURE_VOICEMAIL = "android.telephony.action.CONFIGURE_VOICEMAIL"; field public static final java.lang.String ACTION_CONFIGURE_VOICEMAIL = "android.telephony.action.CONFIGURE_VOICEMAIL";
field public static final java.lang.String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE"; field public static final java.lang.String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE";
field public static final java.lang.String ACTION_RESPOND_VIA_MESSAGE = "android.intent.action.RESPOND_VIA_MESSAGE"; field public static final java.lang.String ACTION_RESPOND_VIA_MESSAGE = "android.intent.action.RESPOND_VIA_MESSAGE";

View File

@@ -66,6 +66,12 @@ import java.util.regex.Pattern;
* a reference to an instance through * a reference to an instance through
* {@link android.content.Context#getSystemService * {@link android.content.Context#getSystemService
* Context.getSystemService(Context.TELEPHONY_SERVICE)}. * Context.getSystemService(Context.TELEPHONY_SERVICE)}.
*
* The returned TelephonyManager will use the default subscription for all calls.
* To call an API for a specific subscription, use {@link #createForSubscriptionId(int)}. e.g.
* <code>
* telephonyManager = defaultSubTelephonyManager.createForSubscriptionId(subId);
* </code>
* <p> * <p>
* Note that access to some telephony information is * Note that access to some telephony information is
* permission-protected. Your application cannot access the protected * permission-protected. Your application cannot access the protected
@@ -101,6 +107,7 @@ public class TelephonyManager {
} }
private final Context mContext; private final Context mContext;
private final int mSubId;
private SubscriptionManager mSubscriptionManager; private SubscriptionManager mSubscriptionManager;
private static String multiSimConfig = private static String multiSimConfig =
@@ -121,6 +128,12 @@ public class TelephonyManager {
/** @hide */ /** @hide */
public TelephonyManager(Context context) { public TelephonyManager(Context context) {
this(context, SubscriptionManager.DEFAULT_SUBSCRIPTION_ID);
}
/** @hide */
public TelephonyManager(Context context, int subId) {
mSubId = subId;
Context appContext = context.getApplicationContext(); Context appContext = context.getApplicationContext();
if (appContext != null) { if (appContext != null) {
mContext = appContext; mContext = appContext;
@@ -138,6 +151,7 @@ public class TelephonyManager {
/** @hide */ /** @hide */
private TelephonyManager() { private TelephonyManager() {
mContext = null; mContext = null;
mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
} }
private static TelephonyManager sInstance = new TelephonyManager(); private static TelephonyManager sInstance = new TelephonyManager();
@@ -231,6 +245,16 @@ public class TelephonyManager {
return (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); return (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
} }
/**
* Create a new TelephonyManager object pinned to the given subscription ID.
*
* @return a TelephonyManager that uses the given subId for all calls.
*/
public TelephonyManager createForSubscriptionId(int subId) {
// Don't reuse any TelephonyManager objects.
return new TelephonyManager(mContext, subId);
}
/** {@hide} */ /** {@hide} */
public boolean isMultiSimEnabled() { public boolean isMultiSimEnabled() {
return (multiSimConfig.equals("dsds") || multiSimConfig.equals("dsda") || return (multiSimConfig.equals("dsds") || multiSimConfig.equals("dsda") ||
@@ -923,7 +947,7 @@ public class TelephonyManager {
* @hide * @hide
*/ */
public void enableLocationUpdates() { public void enableLocationUpdates() {
enableLocationUpdates(getDefaultSubscription()); enableLocationUpdates(getSubId());
} }
/** /**
@@ -935,8 +959,8 @@ public class TelephonyManager {
* CONTROL_LOCATION_UPDATES} * CONTROL_LOCATION_UPDATES}
* *
* @param subId for which the location updates are enabled * @param subId for which the location updates are enabled
* @hide
*/ */
/** @hide */
public void enableLocationUpdates(int subId) { public void enableLocationUpdates(int subId) {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
@@ -957,7 +981,7 @@ public class TelephonyManager {
* @hide * @hide
*/ */
public void disableLocationUpdates() { public void disableLocationUpdates() {
disableLocationUpdates(getDefaultSubscription()); disableLocationUpdates(getSubId());
} }
/** @hide */ /** @hide */
@@ -1018,7 +1042,7 @@ public class TelephonyManager {
*/ */
@SystemApi @SystemApi
public int getCurrentPhoneType() { public int getCurrentPhoneType() {
return getCurrentPhoneType(getDefaultSubscription()); return getCurrentPhoneType(getSubId());
} }
/** /**
@@ -1029,8 +1053,8 @@ public class TelephonyManager {
* @see #PHONE_TYPE_CDMA * @see #PHONE_TYPE_CDMA
* *
* @param subId for which phone type is returned * @param subId for which phone type is returned
* @hide
*/ */
/** {@hide} */
@SystemApi @SystemApi
public int getCurrentPhoneType(int subId) { public int getCurrentPhoneType(int subId) {
int phoneId; int phoneId;
@@ -1258,7 +1282,7 @@ public class TelephonyManager {
* on a CDMA network). * on a CDMA network).
*/ */
public String getNetworkOperatorName() { public String getNetworkOperatorName() {
return getNetworkOperatorName(getDefaultSubscription()); return getNetworkOperatorName(getSubId());
} }
/** /**
@@ -1269,6 +1293,7 @@ public class TelephonyManager {
* unreliable on CDMA networks (use {@link #getPhoneType()} to determine if * unreliable on CDMA networks (use {@link #getPhoneType()} to determine if
* on a CDMA network). * on a CDMA network).
* @param subId * @param subId
* @hide
*/ */
public String getNetworkOperatorName(int subId) { public String getNetworkOperatorName(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId); int phoneId = SubscriptionManager.getPhoneId(subId);
@@ -1295,6 +1320,7 @@ public class TelephonyManager {
* on a CDMA network). * on a CDMA network).
* *
* @param subId * @param subId
* @hide
*/ */
public String getNetworkOperator(int subId) { public String getNetworkOperator(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId); int phoneId = SubscriptionManager.getPhoneId(subId);
@@ -1323,7 +1349,7 @@ public class TelephonyManager {
* Availability: Only when user registered to a network. * Availability: Only when user registered to a network.
*/ */
public boolean isNetworkRoaming() { public boolean isNetworkRoaming() {
return isNetworkRoaming(getDefaultSubscription()); return isNetworkRoaming(getSubId());
} }
/** /**
@@ -1333,6 +1359,7 @@ public class TelephonyManager {
* Availability: Only when user registered to a network. * Availability: Only when user registered to a network.
* *
* @param subId * @param subId
* @hide
*/ */
public boolean isNetworkRoaming(int subId) { public boolean isNetworkRoaming(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId); int phoneId = SubscriptionManager.getPhoneId(subId);
@@ -1361,6 +1388,7 @@ public class TelephonyManager {
* on a CDMA network). * on a CDMA network).
* *
* @param subId for which Network CountryIso is returned * @param subId for which Network CountryIso is returned
* @hide
*/ */
public String getNetworkCountryIso(int subId) { public String getNetworkCountryIso(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId); int phoneId = SubscriptionManager.getPhoneId(subId);
@@ -1469,6 +1497,7 @@ public class TelephonyManager {
* <p> * <p>
* Requires Permission: * Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/ */
public int getNetworkType(int subId) { public int getNetworkType(int subId) {
try { try {
@@ -1513,10 +1542,9 @@ public class TelephonyManager {
* <p> * <p>
* Requires Permission: * Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/ */
public int getDataNetworkType() { public int getDataNetworkType() {
return getDataNetworkType(getDefaultSubscription()); return getDataNetworkType(getSubId());
} }
/** /**
@@ -1529,6 +1557,7 @@ public class TelephonyManager {
* <p> * <p>
* Requires Permission: * Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/ */
public int getDataNetworkType(int subId) { public int getDataNetworkType(int subId) {
try{ try{
@@ -1554,10 +1583,9 @@ public class TelephonyManager {
* <p> * <p>
* Requires Permission: * Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/ */
public int getVoiceNetworkType() { public int getVoiceNetworkType() {
return getVoiceNetworkType(getDefaultSubscription()); return getVoiceNetworkType(getSubId());
} }
/** /**
@@ -1566,6 +1594,7 @@ public class TelephonyManager {
* <p> * <p>
* Requires Permission: * Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/ */
public int getVoiceNetworkType(int subId) { public int getVoiceNetworkType(int subId) {
try{ try{
@@ -1835,6 +1864,7 @@ public class TelephonyManager {
* @see #getSimState * @see #getSimState
* *
* @param subId for which SimOperator is returned * @param subId for which SimOperator is returned
* @hide
*/ */
public String getSimOperator(int subId) { public String getSimOperator(int subId) {
return getSimOperatorNumeric(subId); return getSimOperatorNumeric(subId);
@@ -1911,6 +1941,7 @@ public class TelephonyManager {
* @see #getSimState * @see #getSimState
* *
* @param subId for which SimOperatorName is returned * @param subId for which SimOperatorName is returned
* @hide
*/ */
public String getSimOperatorName(int subId) { public String getSimOperatorName(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId); int phoneId = SubscriptionManager.getPhoneId(subId);
@@ -1938,6 +1969,7 @@ public class TelephonyManager {
* Returns the ISO country code equivalent for the SIM provider's country code. * Returns the ISO country code equivalent for the SIM provider's country code.
* *
* @param subId for which SimCountryIso is returned * @param subId for which SimCountryIso is returned
* @hide
*/ */
public String getSimCountryIso(int subId) { public String getSimCountryIso(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId); int phoneId = SubscriptionManager.getPhoneId(subId);
@@ -1962,7 +1994,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/ */
public String getSimSerialNumber() { public String getSimSerialNumber() {
return getSimSerialNumber(getDefaultSubscription()); return getSimSerialNumber(getSubId());
} }
/** /**
@@ -1972,6 +2004,7 @@ public class TelephonyManager {
* @param subId for which Sim Serial number is returned * @param subId for which Sim Serial number is returned
* Requires Permission: * Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/ */
public String getSimSerialNumber(int subId) { public String getSimSerialNumber(int subId) {
try { try {
@@ -2002,7 +2035,7 @@ public class TelephonyManager {
* @hide * @hide
*/ */
public int getLteOnCdmaMode() { public int getLteOnCdmaMode() {
return getLteOnCdmaMode(getDefaultSubscription()); return getLteOnCdmaMode(getSubId());
} }
/** /**
@@ -2017,8 +2050,8 @@ public class TelephonyManager {
* <p> * <p>
* Requires Permission: * Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/ */
/** {@hide} */
public int getLteOnCdmaMode(int subId) { public int getLteOnCdmaMode(int subId) {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
@@ -2048,7 +2081,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/ */
public String getSubscriberId() { public String getSubscriberId() {
return getSubscriberId(getDefaultSubscription()); return getSubscriberId(getSubId());
} }
/** /**
@@ -2060,6 +2093,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* *
* @param subId whose subscriber id is returned * @param subId whose subscriber id is returned
* @hide
*/ */
public String getSubscriberId(int subId) { public String getSubscriberId(int subId) {
try { try {
@@ -2104,6 +2138,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* *
* @param subId whose subscriber id is returned * @param subId whose subscriber id is returned
* @hide
*/ */
public String getGroupIdLevel1(int subId) { public String getGroupIdLevel1(int subId) {
try { try {
@@ -2131,7 +2166,7 @@ public class TelephonyManager {
* The default SMS app can also use this. * The default SMS app can also use this.
*/ */
public String getLine1Number() { public String getLine1Number() {
return getLine1Number(getDefaultSubscription()); return getLine1Number(getSubId());
} }
/** /**
@@ -2146,6 +2181,7 @@ public class TelephonyManager {
* The default SMS app can also use this. * The default SMS app can also use this.
* *
* @param subId whose phone number for line 1 is returned * @param subId whose phone number for line 1 is returned
* @hide
*/ */
public String getLine1Number(int subId) { public String getLine1Number(int subId) {
String number = null; String number = null;
@@ -2186,7 +2222,7 @@ public class TelephonyManager {
* @return true if the operation was executed correctly. * @return true if the operation was executed correctly.
*/ */
public boolean setLine1NumberForDisplay(String alphaTag, String number) { public boolean setLine1NumberForDisplay(String alphaTag, String number) {
return setLine1NumberForDisplay(getDefaultSubscription(), alphaTag, number); return setLine1NumberForDisplay(getSubId(), alphaTag, number);
} }
/** /**
@@ -2202,6 +2238,7 @@ public class TelephonyManager {
* @param alphaTag alpha-tagging of the dailing nubmer * @param alphaTag alpha-tagging of the dailing nubmer
* @param number The dialing number * @param number The dialing number
* @return true if the operation was executed correctly. * @return true if the operation was executed correctly.
* @hide
*/ */
public boolean setLine1NumberForDisplay(int subId, String alphaTag, String number) { public boolean setLine1NumberForDisplay(int subId, String alphaTag, String number) {
try { try {
@@ -2224,7 +2261,7 @@ public class TelephonyManager {
* nobody seems to call this. * nobody seems to call this.
*/ */
public String getLine1AlphaTag() { public String getLine1AlphaTag() {
return getLine1AlphaTag(getDefaultSubscription()); return getLine1AlphaTag(getSubId());
} }
/** /**
@@ -2236,6 +2273,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @param subId whose alphabetic identifier associated with line 1 is returned * @param subId whose alphabetic identifier associated with line 1 is returned
* nobody seems to call this. * nobody seems to call this.
* @hide
*/ */
public String getLine1AlphaTag(int subId) { public String getLine1AlphaTag(int subId) {
String alphaTag = null; String alphaTag = null;
@@ -2292,7 +2330,7 @@ public class TelephonyManager {
* @hide * @hide
*/ */
public String getMsisdn() { public String getMsisdn() {
return getMsisdn(getDefaultSubscription()); return getMsisdn(getSubId());
} }
/** /**
@@ -2303,8 +2341,8 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* *
* @param subId for which msisdn is returned * @param subId for which msisdn is returned
* @hide
*/ */
/** {@hide} */
public String getMsisdn(int subId) { public String getMsisdn(int subId) {
try { try {
IPhoneSubInfo info = getSubscriberInfo(); IPhoneSubInfo info = getSubscriberInfo();
@@ -2326,7 +2364,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/ */
public String getVoiceMailNumber() { public String getVoiceMailNumber() {
return getVoiceMailNumber(getDefaultSubscription()); return getVoiceMailNumber(getSubId());
} }
/** /**
@@ -2336,6 +2374,7 @@ public class TelephonyManager {
* Requires Permission: * Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @param subId whose voice mail number is returned * @param subId whose voice mail number is returned
* @hide
*/ */
public String getVoiceMailNumber(int subId) { public String getVoiceMailNumber(int subId) {
try { try {
@@ -2360,7 +2399,7 @@ public class TelephonyManager {
* @hide * @hide
*/ */
public String getCompleteVoiceMailNumber() { public String getCompleteVoiceMailNumber() {
return getCompleteVoiceMailNumber(getDefaultSubscription()); return getCompleteVoiceMailNumber(getSubId());
} }
/** /**
@@ -2370,8 +2409,8 @@ public class TelephonyManager {
* {@link android.Manifest.permission#CALL_PRIVILEGED CALL_PRIVILEGED} * {@link android.Manifest.permission#CALL_PRIVILEGED CALL_PRIVILEGED}
* *
* @param subId * @param subId
* @hide
*/ */
/** {@hide} */
public String getCompleteVoiceMailNumber(int subId) { public String getCompleteVoiceMailNumber(int subId) {
try { try {
IPhoneSubInfo info = getSubscriberInfo(); IPhoneSubInfo info = getSubscriberInfo();
@@ -2396,7 +2435,7 @@ public class TelephonyManager {
* @param number The voicemail number. * @param number The voicemail number.
*/ */
public boolean setVoiceMailNumber(String alphaTag, String number) { public boolean setVoiceMailNumber(String alphaTag, String number) {
return setVoiceMailNumber(getDefaultSubscription(), alphaTag, number); return setVoiceMailNumber(getSubId(), alphaTag, number);
} }
/** /**
@@ -2408,6 +2447,7 @@ public class TelephonyManager {
* @param subId The subscription id. * @param subId The subscription id.
* @param alphaTag The alpha tag to display. * @param alphaTag The alpha tag to display.
* @param number The voicemail number. * @param number The voicemail number.
* @hide
*/ */
public boolean setVoiceMailNumber(int subId, String alphaTag, String number) { public boolean setVoiceMailNumber(int subId, String alphaTag, String number) {
try { try {
@@ -2429,7 +2469,7 @@ public class TelephonyManager {
* @hide * @hide
*/ */
public int getVoiceMessageCount() { public int getVoiceMessageCount() {
return getVoiceMessageCount(getDefaultSubscription()); return getVoiceMessageCount(getSubId());
} }
/** /**
@@ -2438,8 +2478,8 @@ public class TelephonyManager {
* Requires Permission: * Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @param subId whose voice message count is returned * @param subId whose voice message count is returned
* @hide
*/ */
/** {@hide} */
public int getVoiceMessageCount(int subId) { public int getVoiceMessageCount(int subId) {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
@@ -2462,7 +2502,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/ */
public String getVoiceMailAlphaTag() { public String getVoiceMailAlphaTag() {
return getVoiceMailAlphaTag(getDefaultSubscription()); return getVoiceMailAlphaTag(getSubId());
} }
/** /**
@@ -2473,6 +2513,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @param subId whose alphabetic identifier associated with the * @param subId whose alphabetic identifier associated with the
* voice mail number is returned * voice mail number is returned
* @hide
*/ */
public String getVoiceMailAlphaTag(int subId) { public String getVoiceMailAlphaTag(int subId) {
try { try {
@@ -2590,6 +2631,7 @@ public class TelephonyManager {
* for a subscription. * for a subscription.
* *
* @param subId whose call state is returned * @param subId whose call state is returned
* @hide
*/ */
public int getCallState(int subId) { public int getCallState(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId); int phoneId = SubscriptionManager.getPhoneId(subId);
@@ -2759,7 +2801,7 @@ public class TelephonyManager {
* @hide * @hide
*/ */
public int getCdmaEriIconIndex() { public int getCdmaEriIconIndex() {
return getCdmaEriIconIndex(getDefaultSubscription()); return getCdmaEriIconIndex(getSubId());
} }
/** /**
@@ -2767,8 +2809,8 @@ public class TelephonyManager {
* <p> * <p>
* Requires Permission: * Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/ */
/** {@hide} */
public int getCdmaEriIconIndex(int subId) { public int getCdmaEriIconIndex(int subId) {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
@@ -2794,7 +2836,7 @@ public class TelephonyManager {
* @hide * @hide
*/ */
public int getCdmaEriIconMode() { public int getCdmaEriIconMode() {
return getCdmaEriIconMode(getDefaultSubscription()); return getCdmaEriIconMode(getSubId());
} }
/** /**
@@ -2805,8 +2847,8 @@ public class TelephonyManager {
* <p> * <p>
* Requires Permission: * Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/ */
/** {@hide} */
public int getCdmaEriIconMode(int subId) { public int getCdmaEriIconMode(int subId) {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
@@ -2830,7 +2872,7 @@ public class TelephonyManager {
* @hide * @hide
*/ */
public String getCdmaEriText() { public String getCdmaEriText() {
return getCdmaEriText(getDefaultSubscription()); return getCdmaEriText(getSubId());
} }
/** /**
@@ -2839,8 +2881,8 @@ public class TelephonyManager {
* <p> * <p>
* Requires Permission: * Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/ */
/** {@hide} */
public String getCdmaEriText(int subId) { public String getCdmaEriText(int subId) {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
@@ -2993,7 +3035,7 @@ public class TelephonyManager {
* @return an IccOpenLogicalChannelResponse object. * @return an IccOpenLogicalChannelResponse object.
*/ */
public IccOpenLogicalChannelResponse iccOpenLogicalChannel(String AID) { public IccOpenLogicalChannelResponse iccOpenLogicalChannel(String AID) {
return iccOpenLogicalChannel(getDefaultSubscription(), AID); return iccOpenLogicalChannel(getSubId(), AID);
} }
/** /**
@@ -3008,6 +3050,7 @@ public class TelephonyManager {
* @param subId The subscription to use. * @param subId The subscription to use.
* @param AID Application id. See ETSI 102.221 and 101.220. * @param AID Application id. See ETSI 102.221 and 101.220.
* @return an IccOpenLogicalChannelResponse object. * @return an IccOpenLogicalChannelResponse object.
* @hide
*/ */
public IccOpenLogicalChannelResponse iccOpenLogicalChannel(int subId, String AID) { public IccOpenLogicalChannelResponse iccOpenLogicalChannel(int subId, String AID) {
try { try {
@@ -3034,7 +3077,7 @@ public class TelephonyManager {
* @return true if the channel was closed successfully. * @return true if the channel was closed successfully.
*/ */
public boolean iccCloseLogicalChannel(int channel) { public boolean iccCloseLogicalChannel(int channel) {
return iccCloseLogicalChannel(getDefaultSubscription(), channel); return iccCloseLogicalChannel(getSubId(), channel);
} }
/** /**
@@ -3050,6 +3093,7 @@ public class TelephonyManager {
* @param channel is the channel id to be closed as retruned by a successful * @param channel is the channel id to be closed as retruned by a successful
* iccOpenLogicalChannel. * iccOpenLogicalChannel.
* @return true if the channel was closed successfully. * @return true if the channel was closed successfully.
* @hide
*/ */
public boolean iccCloseLogicalChannel(int subId, int channel) { public boolean iccCloseLogicalChannel(int subId, int channel) {
try { try {
@@ -3085,7 +3129,7 @@ public class TelephonyManager {
*/ */
public String iccTransmitApduLogicalChannel(int channel, int cla, public String iccTransmitApduLogicalChannel(int channel, int cla,
int instruction, int p1, int p2, int p3, String data) { int instruction, int p1, int p2, int p3, String data) {
return iccTransmitApduLogicalChannel(getDefaultSubscription(), channel, cla, return iccTransmitApduLogicalChannel(getSubId(), channel, cla,
instruction, p1, p2, p3, data); instruction, p1, p2, p3, data);
} }
@@ -3110,6 +3154,7 @@ public class TelephonyManager {
* @param data Data to be sent with the APDU. * @param data Data to be sent with the APDU.
* @return The APDU response from the ICC card with the status appended at * @return The APDU response from the ICC card with the status appended at
* the end. * the end.
* @hide
*/ */
public String iccTransmitApduLogicalChannel(int subId, int channel, int cla, public String iccTransmitApduLogicalChannel(int subId, int channel, int cla,
int instruction, int p1, int p2, int p3, String data) { int instruction, int p1, int p2, int p3, String data) {
@@ -3145,7 +3190,7 @@ public class TelephonyManager {
*/ */
public String iccTransmitApduBasicChannel(int cla, public String iccTransmitApduBasicChannel(int cla,
int instruction, int p1, int p2, int p3, String data) { int instruction, int p1, int p2, int p3, String data) {
return iccTransmitApduBasicChannel(getDefaultSubscription(), cla, return iccTransmitApduBasicChannel(getSubId(), cla,
instruction, p1, p2, p3, data); instruction, p1, p2, p3, data);
} }
@@ -3168,6 +3213,7 @@ public class TelephonyManager {
* @param data Data to be sent with the APDU. * @param data Data to be sent with the APDU.
* @return The APDU response from the ICC card with the status appended at * @return The APDU response from the ICC card with the status appended at
* the end. * the end.
* @hide
*/ */
public String iccTransmitApduBasicChannel(int subId, int cla, public String iccTransmitApduBasicChannel(int subId, int cla,
int instruction, int p1, int p2, int p3, String data) { int instruction, int p1, int p2, int p3, String data) {
@@ -3199,7 +3245,7 @@ public class TelephonyManager {
*/ */
public byte[] iccExchangeSimIO(int fileID, int command, int p1, int p2, int p3, public byte[] iccExchangeSimIO(int fileID, int command, int p1, int p2, int p3,
String filePath) { String filePath) {
return iccExchangeSimIO(getDefaultSubscription(), fileID, command, p1, p2, p3, filePath); return iccExchangeSimIO(getSubId(), fileID, command, p1, p2, p3, filePath);
} }
/** /**
@@ -3217,6 +3263,7 @@ public class TelephonyManager {
* @param p3 P3 value of the APDU command. * @param p3 P3 value of the APDU command.
* @param filePath * @param filePath
* @return The APDU response. * @return The APDU response.
* @hide
*/ */
public byte[] iccExchangeSimIO(int subId, int fileID, int command, int p1, int p2, public byte[] iccExchangeSimIO(int subId, int fileID, int command, int p1, int p2,
int p3, String filePath) { int p3, String filePath) {
@@ -3245,7 +3292,7 @@ public class TelephonyManager {
* returns an empty string. * returns an empty string.
*/ */
public String sendEnvelopeWithStatus(String content) { public String sendEnvelopeWithStatus(String content) {
return sendEnvelopeWithStatus(getDefaultSubscription(), content); return sendEnvelopeWithStatus(getSubId(), content);
} }
/** /**
@@ -3262,6 +3309,7 @@ public class TelephonyManager {
* @return The APDU response from the ICC card in hexadecimal format * @return The APDU response from the ICC card in hexadecimal format
* with the last 4 bytes being the status word. If the command fails, * with the last 4 bytes being the status word. If the command fails,
* returns an empty string. * returns an empty string.
* @hide
*/ */
public String sendEnvelopeWithStatus(int subId, String content) { public String sendEnvelopeWithStatus(int subId, String content) {
try { try {
@@ -3380,6 +3428,19 @@ public class TelephonyManager {
return false; return false;
} }
/**
* Return an appropriate subscription ID for any situation.
*
* If this object has been created with {@link #createForSubscriptionId}, then the provided
* subId is returned. Otherwise, the default subId will be returned.
*/
private int getSubId() {
if (mSubId == SubscriptionManager.DEFAULT_SUBSCRIPTION_ID) {
return getDefaultSubscription();
}
return mSubId;
}
/** /**
* Returns Default subscription. * Returns Default subscription.
*/ */
@@ -3662,7 +3723,7 @@ public class TelephonyManager {
* @see #hasCarrierPrivileges * @see #hasCarrierPrivileges
*/ */
public String getIccAuthentication(int appType, int authType, String data) { public String getIccAuthentication(int appType, int authType, String data) {
return getIccAuthentication(getDefaultSubscription(), appType, authType, data); return getIccAuthentication(getSubId(), appType, authType, data);
} }
/** /**
@@ -3680,8 +3741,8 @@ public class TelephonyManager {
* @return the response of authentication, or null if not available * @return the response of authentication, or null if not available
* *
* @see #hasCarrierPrivileges * @see #hasCarrierPrivileges
* @hide
*/ */
public String getIccAuthentication(int subId, int appType, int authType, String data) { public String getIccAuthentication(int subId, int appType, int authType, String data) {
try { try {
IPhoneSubInfo info = getSubscriberInfo(); IPhoneSubInfo info = getSubscriberInfo();
@@ -3760,6 +3821,7 @@ public class TelephonyManager {
* Or the calling app has carrier privileges. @see #hasCarrierPrivileges * Or the calling app has carrier privileges. @see #hasCarrierPrivileges
* *
* @hide * @hide
* TODO: Add an overload that takes no args.
*/ */
public void setNetworkSelectionModeAutomatic(int subId) { public void setNetworkSelectionModeAutomatic(int subId) {
try { try {
@@ -3785,6 +3847,7 @@ public class TelephonyManager {
* Or the calling app has carrier privileges. @see #hasCarrierPrivileges * Or the calling app has carrier privileges. @see #hasCarrierPrivileges
* *
* @hide * @hide
* TODO: Add an overload that takes no args.
*/ */
public CellNetworkScanResult getCellNetworkScanResults(int subId) { public CellNetworkScanResult getCellNetworkScanResults(int subId) {
try { try {
@@ -3808,6 +3871,7 @@ public class TelephonyManager {
* Or the calling app has carrier privileges. @see #hasCarrierPrivileges * Or the calling app has carrier privileges. @see #hasCarrierPrivileges
* *
* @hide * @hide
* TODO: Add an overload that takes no args.
*/ */
public boolean setNetworkSelectionModeManual(int subId, OperatorInfo operator, public boolean setNetworkSelectionModeManual(int subId, OperatorInfo operator,
boolean persistSelection) { boolean persistSelection) {
@@ -3859,7 +3923,7 @@ public class TelephonyManager {
* @return true on success; false on any failure. * @return true on success; false on any failure.
*/ */
public boolean setPreferredNetworkTypeToGlobal() { public boolean setPreferredNetworkTypeToGlobal() {
return setPreferredNetworkTypeToGlobal(getDefaultSubscription()); return setPreferredNetworkTypeToGlobal(getSubId());
} }
/** /**
@@ -3870,6 +3934,7 @@ public class TelephonyManager {
* @see #hasCarrierPrivileges * @see #hasCarrierPrivileges
* *
* @return true on success; false on any failure. * @return true on success; false on any failure.
* @hide
*/ */
public boolean setPreferredNetworkTypeToGlobal(int subId) { public boolean setPreferredNetworkTypeToGlobal(int subId) {
return setPreferredNetworkType(subId, RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA); return setPreferredNetworkType(subId, RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA);
@@ -3919,7 +3984,7 @@ public class TelephonyManager {
* @return true if the app has carrier privileges. * @return true if the app has carrier privileges.
*/ */
public boolean hasCarrierPrivileges() { public boolean hasCarrierPrivileges() {
return hasCarrierPrivileges(getDefaultSubscription()); return hasCarrierPrivileges(getSubId());
} }
/** /**
@@ -3931,12 +3996,13 @@ public class TelephonyManager {
* *
* @param subId The subscription to use. * @param subId The subscription to use.
* @return true if the app has carrier privileges. * @return true if the app has carrier privileges.
* @hide
*/ */
public boolean hasCarrierPrivileges(int subId) { public boolean hasCarrierPrivileges(int subId) {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony != null) { if (telephony != null) {
return telephony.getCarrierPrivilegeStatus(subId) == return telephony.getCarrierPrivilegeStatus(mSubId) ==
CARRIER_PRIVILEGE_STATUS_HAS_ACCESS; CARRIER_PRIVILEGE_STATUS_HAS_ACCESS;
} }
} catch (RemoteException ex) { } catch (RemoteException ex) {
@@ -3962,7 +4028,7 @@ public class TelephonyManager {
* @return true if the operation was executed correctly. * @return true if the operation was executed correctly.
*/ */
public boolean setOperatorBrandOverride(String brand) { public boolean setOperatorBrandOverride(String brand) {
return setOperatorBrandOverride(getDefaultSubscription(), brand); return setOperatorBrandOverride(getSubId(), brand);
} }
/** /**
@@ -3979,6 +4045,7 @@ public class TelephonyManager {
* @param subId The subscription to use. * @param subId The subscription to use.
* @param brand The brand name to display/set. * @param brand The brand name to display/set.
* @return true if the operation was executed correctly. * @return true if the operation was executed correctly.
* @hide
*/ */
public boolean setOperatorBrandOverride(int subId, String brand) { public boolean setOperatorBrandOverride(int subId, String brand) {
try { try {
@@ -4015,7 +4082,7 @@ public class TelephonyManager {
public boolean setRoamingOverride(List<String> gsmRoamingList, public boolean setRoamingOverride(List<String> gsmRoamingList,
List<String> gsmNonRoamingList, List<String> cdmaRoamingList, List<String> gsmNonRoamingList, List<String> cdmaRoamingList,
List<String> cdmaNonRoamingList) { List<String> cdmaNonRoamingList) {
return setRoamingOverride(getDefaultSubscription(), gsmRoamingList, gsmNonRoamingList, return setRoamingOverride(getSubId(), gsmRoamingList, gsmNonRoamingList,
cdmaRoamingList, cdmaNonRoamingList); cdmaRoamingList, cdmaNonRoamingList);
} }
@@ -4062,7 +4129,7 @@ public class TelephonyManager {
/** @hide */ /** @hide */
@SystemApi @SystemApi
public String getCdmaMdn() { public String getCdmaMdn() {
return getCdmaMdn(getDefaultSubscription()); return getCdmaMdn(getSubId());
} }
/** @hide */ /** @hide */
@@ -4083,7 +4150,7 @@ public class TelephonyManager {
/** @hide */ /** @hide */
@SystemApi @SystemApi
public String getCdmaMin() { public String getCdmaMin() {
return getCdmaMin(getDefaultSubscription()); return getCdmaMin(getSubId());
} }
/** @hide */ /** @hide */
@@ -4626,7 +4693,8 @@ public class TelephonyManager {
* retrieves value for setting "name", and if that is not found throws * retrieves value for setting "name", and if that is not found throws
* SettingNotFoundException * SettingNotFoundException
* *
* @hide */ * @hide
*/
public static int getIntWithSubId(ContentResolver cr, String name, int subId) public static int getIntWithSubId(ContentResolver cr, String name, int subId)
throws SettingNotFoundException { throws SettingNotFoundException {
try { try {