resolve merge conflicts of 4c04097 to nyc-mr1-dev

Change-Id: I256514588af20985108f72a5e204811904f87c9c
This commit is contained in:
Jonathan Basseri
2016-05-26 11:41:17 -07:00
4 changed files with 126 additions and 139 deletions

View File

@@ -37365,70 +37365,48 @@ package android.telephony {
public class TelephonyManager {
method public boolean canChangeDtmfToneLength();
method public android.telephony.TelephonyManager createForSubscriptionId(int);
method public java.util.List<android.telephony.CellInfo> getAllCellInfo();
method public int getCallState();
method public int getCallState(int);
method public android.telephony.CellLocation getCellLocation();
method public int getDataActivity();
method public int getDataNetworkType(int);
method public int getDataNetworkType();
method public int getDataState();
method public java.lang.String getDeviceId();
method public java.lang.String getDeviceId(int);
method public java.lang.String getDeviceSoftwareVersion();
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, int, java.lang.String);
method public java.lang.String getLine1AlphaTag(int);
method public java.lang.String getLine1Number();
method public java.lang.String getLine1Number(int);
method public java.lang.String getMmsUAProfUrl();
method public java.lang.String getMmsUserAgent();
method public deprecated java.util.List<android.telephony.NeighboringCellInfo> getNeighboringCellInfo();
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(int);
method public java.lang.String getNetworkOperatorName();
method public java.lang.String getNetworkOperatorName(int);
method public int getNetworkType();
method public int getNetworkType(int);
method public int getPhoneCount();
method public int getPhoneType();
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(int);
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(int);
method public int getSimState();
method public java.lang.String getSubscriberId();
method public java.lang.String getSubscriberId(int);
method public java.util.List<android.telephony.TelephonyHistogram> getTelephonyHistograms();
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(int);
method public int getVoiceNetworkType(int);
method public int getVoiceNetworkType();
method public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle);
method public boolean hasCarrierPrivileges();
method public boolean hasCarrierPrivileges(int);
method public boolean hasIccCard();
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, int, 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, 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 isNetworkRoaming();
method public boolean isNetworkRoaming(int);
method public boolean isSmsCapable();
method public boolean isTtyModeSupported();
method public boolean isVoiceCapable();
@@ -37436,15 +37414,10 @@ package android.telephony {
method public boolean isWorldPhone();
method public void listen(android.telephony.PhoneStateListener, int);
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(int, java.lang.String, 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(int);
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_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";

View File

@@ -40302,6 +40302,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 createForSubscriptionId(int);
method public void dial(java.lang.String);
method public boolean disableDataConnectivity();
method public boolean enableDataConnectivity();
@@ -40309,7 +40310,6 @@ package android.telephony {
method public boolean endCall();
method public java.util.List<android.telephony.CellInfo> getAllCellInfo();
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> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int);
method public java.lang.String getCdmaMdn();
@@ -40322,69 +40322,47 @@ package android.telephony {
method public int getDataActivity();
method public boolean getDataEnabled();
method public boolean getDataEnabled(int);
method public int getDataNetworkType(int);
method public int getDataNetworkType();
method public int getDataState();
method public java.lang.String getDeviceId();
method public java.lang.String getDeviceId(int);
method public java.lang.String getDeviceSoftwareVersion();
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, int, java.lang.String);
method public java.lang.String getLine1AlphaTag(int);
method public java.lang.String getLine1Number();
method public java.lang.String getLine1Number(int);
method public java.lang.String getMmsUAProfUrl();
method public java.lang.String getMmsUserAgent();
method public deprecated java.util.List<android.telephony.NeighboringCellInfo> getNeighboringCellInfo();
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(int);
method public java.lang.String getNetworkOperatorName();
method public java.lang.String getNetworkOperatorName(int);
method public int getNetworkType();
method public int getNetworkType(int);
method public int getPhoneCount();
method public int getPhoneType();
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(int);
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(int);
method public int getSimState();
method public java.lang.String getSubscriberId();
method public java.lang.String getSubscriberId(int);
method public java.util.List<android.telephony.TelephonyHistogram> getTelephonyHistograms();
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(int);
method public int getVoiceNetworkType(int);
method public int getVoiceNetworkType();
method public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle);
method public boolean handlePinMmi(java.lang.String);
method public boolean handlePinMmiForSubscriber(int, java.lang.String);
method public boolean hasCarrierPrivileges();
method public boolean hasCarrierPrivileges(int);
method public boolean hasIccCard();
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, int, 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, 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 isHearingAidCompatibilitySupported();
method public boolean isIdle();
method public boolean isNetworkRoaming();
method public boolean isNetworkRoaming(int);
method public boolean isOffhook();
method public boolean isRadioOn();
method public boolean isRinging();
@@ -40397,19 +40375,14 @@ package android.telephony {
method public void listen(android.telephony.PhoneStateListener, int);
method public boolean needsOtaServiceProvisioning();
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(int, boolean);
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(int, java.lang.String);
method public boolean setPreferredNetworkTypeToGlobal();
method public boolean setPreferredNetworkTypeToGlobal(int);
method public boolean setRadio(boolean);
method public boolean setRadioPower(boolean);
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 boolean supplyPin(java.lang.String);
method public int[] supplyPinReportResult(java.lang.String);

View File

@@ -37443,70 +37443,48 @@ package android.telephony {
public class TelephonyManager {
method public boolean canChangeDtmfToneLength();
method public android.telephony.TelephonyManager createForSubscriptionId(int);
method public java.util.List<android.telephony.CellInfo> getAllCellInfo();
method public int getCallState();
method public int getCallState(int);
method public android.telephony.CellLocation getCellLocation();
method public int getDataActivity();
method public int getDataNetworkType(int);
method public int getDataNetworkType();
method public int getDataState();
method public java.lang.String getDeviceId();
method public java.lang.String getDeviceId(int);
method public java.lang.String getDeviceSoftwareVersion();
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, int, java.lang.String);
method public java.lang.String getLine1AlphaTag(int);
method public java.lang.String getLine1Number();
method public java.lang.String getLine1Number(int);
method public java.lang.String getMmsUAProfUrl();
method public java.lang.String getMmsUserAgent();
method public deprecated java.util.List<android.telephony.NeighboringCellInfo> getNeighboringCellInfo();
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(int);
method public java.lang.String getNetworkOperatorName();
method public java.lang.String getNetworkOperatorName(int);
method public int getNetworkType();
method public int getNetworkType(int);
method public int getPhoneCount();
method public int getPhoneType();
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(int);
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(int);
method public int getSimState();
method public java.lang.String getSubscriberId();
method public java.lang.String getSubscriberId(int);
method public java.util.List<android.telephony.TelephonyHistogram> getTelephonyHistograms();
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(int);
method public int getVoiceNetworkType(int);
method public int getVoiceNetworkType();
method public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle);
method public boolean hasCarrierPrivileges();
method public boolean hasCarrierPrivileges(int);
method public boolean hasIccCard();
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, int, 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, 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 isNetworkRoaming();
method public boolean isNetworkRoaming(int);
method public boolean isSmsCapable();
method public boolean isTtyModeSupported();
method public boolean isVoiceCapable();
@@ -37514,15 +37492,10 @@ package android.telephony {
method public boolean isWorldPhone();
method public void listen(android.telephony.PhoneStateListener, int);
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(int, java.lang.String, 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(int);
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_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";

View File

@@ -69,6 +69,12 @@ import java.util.regex.Pattern;
* a reference to an instance through
* {@link android.content.Context#getSystemService
* 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>
* Note that access to some telephony information is
* permission-protected. Your application cannot access the protected
@@ -104,6 +110,7 @@ public class TelephonyManager {
}
private final Context mContext;
private final int mSubId;
private SubscriptionManager mSubscriptionManager;
private static String multiSimConfig =
@@ -124,6 +131,12 @@ public class TelephonyManager {
/** @hide */
public TelephonyManager(Context context) {
this(context, SubscriptionManager.DEFAULT_SUBSCRIPTION_ID);
}
/** @hide */
public TelephonyManager(Context context, int subId) {
mSubId = subId;
Context appContext = context.getApplicationContext();
if (appContext != null) {
mContext = appContext;
@@ -141,6 +154,7 @@ public class TelephonyManager {
/** @hide */
private TelephonyManager() {
mContext = null;
mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
}
private static TelephonyManager sInstance = new TelephonyManager();
@@ -234,6 +248,16 @@ public class TelephonyManager {
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} */
public boolean isMultiSimEnabled() {
return (multiSimConfig.equals("dsds") || multiSimConfig.equals("dsda") ||
@@ -926,7 +950,7 @@ public class TelephonyManager {
* @hide
*/
public void enableLocationUpdates() {
enableLocationUpdates(getDefaultSubscription());
enableLocationUpdates(getSubId());
}
/**
@@ -938,8 +962,8 @@ public class TelephonyManager {
* CONTROL_LOCATION_UPDATES}
*
* @param subId for which the location updates are enabled
* @hide
*/
/** @hide */
public void enableLocationUpdates(int subId) {
try {
ITelephony telephony = getITelephony();
@@ -960,7 +984,7 @@ public class TelephonyManager {
* @hide
*/
public void disableLocationUpdates() {
disableLocationUpdates(getDefaultSubscription());
disableLocationUpdates(getSubId());
}
/** @hide */
@@ -1021,7 +1045,7 @@ public class TelephonyManager {
*/
@SystemApi
public int getCurrentPhoneType() {
return getCurrentPhoneType(getDefaultSubscription());
return getCurrentPhoneType(getSubId());
}
/**
@@ -1032,8 +1056,8 @@ public class TelephonyManager {
* @see #PHONE_TYPE_CDMA
*
* @param subId for which phone type is returned
* @hide
*/
/** {@hide} */
@SystemApi
public int getCurrentPhoneType(int subId) {
int phoneId;
@@ -1261,7 +1285,7 @@ public class TelephonyManager {
* on a CDMA network).
*/
public String getNetworkOperatorName() {
return getNetworkOperatorName(getDefaultSubscription());
return getNetworkOperatorName(getSubId());
}
/**
@@ -1272,6 +1296,7 @@ public class TelephonyManager {
* unreliable on CDMA networks (use {@link #getPhoneType()} to determine if
* on a CDMA network).
* @param subId
* @hide
*/
public String getNetworkOperatorName(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId);
@@ -1298,6 +1323,7 @@ public class TelephonyManager {
* on a CDMA network).
*
* @param subId
* @hide
*/
public String getNetworkOperator(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId);
@@ -1326,7 +1352,7 @@ public class TelephonyManager {
* Availability: Only when user registered to a network.
*/
public boolean isNetworkRoaming() {
return isNetworkRoaming(getDefaultSubscription());
return isNetworkRoaming(getSubId());
}
/**
@@ -1336,6 +1362,7 @@ public class TelephonyManager {
* Availability: Only when user registered to a network.
*
* @param subId
* @hide
*/
public boolean isNetworkRoaming(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId);
@@ -1364,6 +1391,7 @@ public class TelephonyManager {
* on a CDMA network).
*
* @param subId for which Network CountryIso is returned
* @hide
*/
public String getNetworkCountryIso(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId);
@@ -1472,6 +1500,7 @@ public class TelephonyManager {
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
public int getNetworkType(int subId) {
try {
@@ -1516,10 +1545,9 @@ public class TelephonyManager {
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
public int getDataNetworkType() {
return getDataNetworkType(getDefaultSubscription());
return getDataNetworkType(getSubId());
}
/**
@@ -1532,6 +1560,7 @@ public class TelephonyManager {
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
public int getDataNetworkType(int subId) {
try{
@@ -1557,10 +1586,9 @@ public class TelephonyManager {
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
public int getVoiceNetworkType() {
return getVoiceNetworkType(getDefaultSubscription());
return getVoiceNetworkType(getSubId());
}
/**
@@ -1569,6 +1597,7 @@ public class TelephonyManager {
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
public int getVoiceNetworkType(int subId) {
try{
@@ -1843,6 +1872,7 @@ public class TelephonyManager {
* @see #getSimState
*
* @param subId for which SimOperator is returned
* @hide
*/
public String getSimOperator(int subId) {
return getSimOperatorNumeric(subId);
@@ -1919,6 +1949,7 @@ public class TelephonyManager {
* @see #getSimState
*
* @param subId for which SimOperatorName is returned
* @hide
*/
public String getSimOperatorName(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId);
@@ -1946,6 +1977,7 @@ public class TelephonyManager {
* Returns the ISO country code equivalent for the SIM provider's country code.
*
* @param subId for which SimCountryIso is returned
* @hide
*/
public String getSimCountryIso(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId);
@@ -1970,7 +2002,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
public String getSimSerialNumber() {
return getSimSerialNumber(getDefaultSubscription());
return getSimSerialNumber(getSubId());
}
/**
@@ -1980,6 +2012,7 @@ public class TelephonyManager {
* @param subId for which Sim Serial number is returned
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
public String getSimSerialNumber(int subId) {
try {
@@ -2010,7 +2043,7 @@ public class TelephonyManager {
* @hide
*/
public int getLteOnCdmaMode() {
return getLteOnCdmaMode(getDefaultSubscription());
return getLteOnCdmaMode(getSubId());
}
/**
@@ -2025,8 +2058,8 @@ public class TelephonyManager {
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
/** {@hide} */
public int getLteOnCdmaMode(int subId) {
try {
ITelephony telephony = getITelephony();
@@ -2056,7 +2089,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
public String getSubscriberId() {
return getSubscriberId(getDefaultSubscription());
return getSubscriberId(getSubId());
}
/**
@@ -2068,6 +2101,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*
* @param subId whose subscriber id is returned
* @hide
*/
public String getSubscriberId(int subId) {
try {
@@ -2112,6 +2146,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*
* @param subId whose subscriber id is returned
* @hide
*/
public String getGroupIdLevel1(int subId) {
try {
@@ -2139,7 +2174,7 @@ public class TelephonyManager {
* The default SMS app can also use this.
*/
public String getLine1Number() {
return getLine1Number(getDefaultSubscription());
return getLine1Number(getSubId());
}
/**
@@ -2154,6 +2189,7 @@ public class TelephonyManager {
* The default SMS app can also use this.
*
* @param subId whose phone number for line 1 is returned
* @hide
*/
public String getLine1Number(int subId) {
String number = null;
@@ -2194,7 +2230,7 @@ public class TelephonyManager {
* @return true if the operation was executed correctly.
*/
public boolean setLine1NumberForDisplay(String alphaTag, String number) {
return setLine1NumberForDisplay(getDefaultSubscription(), alphaTag, number);
return setLine1NumberForDisplay(getSubId(), alphaTag, number);
}
/**
@@ -2210,6 +2246,7 @@ public class TelephonyManager {
* @param alphaTag alpha-tagging of the dailing nubmer
* @param number The dialing number
* @return true if the operation was executed correctly.
* @hide
*/
public boolean setLine1NumberForDisplay(int subId, String alphaTag, String number) {
try {
@@ -2232,7 +2269,7 @@ public class TelephonyManager {
* nobody seems to call this.
*/
public String getLine1AlphaTag() {
return getLine1AlphaTag(getDefaultSubscription());
return getLine1AlphaTag(getSubId());
}
/**
@@ -2244,6 +2281,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @param subId whose alphabetic identifier associated with line 1 is returned
* nobody seems to call this.
* @hide
*/
public String getLine1AlphaTag(int subId) {
String alphaTag = null;
@@ -2300,7 +2338,7 @@ public class TelephonyManager {
* @hide
*/
public String getMsisdn() {
return getMsisdn(getDefaultSubscription());
return getMsisdn(getSubId());
}
/**
@@ -2311,8 +2349,8 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*
* @param subId for which msisdn is returned
* @hide
*/
/** {@hide} */
public String getMsisdn(int subId) {
try {
IPhoneSubInfo info = getSubscriberInfo();
@@ -2334,7 +2372,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
public String getVoiceMailNumber() {
return getVoiceMailNumber(getDefaultSubscription());
return getVoiceMailNumber(getSubId());
}
/**
@@ -2344,6 +2382,7 @@ public class TelephonyManager {
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @param subId whose voice mail number is returned
* @hide
*/
public String getVoiceMailNumber(int subId) {
try {
@@ -2368,7 +2407,7 @@ public class TelephonyManager {
* @hide
*/
public String getCompleteVoiceMailNumber() {
return getCompleteVoiceMailNumber(getDefaultSubscription());
return getCompleteVoiceMailNumber(getSubId());
}
/**
@@ -2378,8 +2417,8 @@ public class TelephonyManager {
* {@link android.Manifest.permission#CALL_PRIVILEGED CALL_PRIVILEGED}
*
* @param subId
* @hide
*/
/** {@hide} */
public String getCompleteVoiceMailNumber(int subId) {
try {
IPhoneSubInfo info = getSubscriberInfo();
@@ -2404,7 +2443,7 @@ public class TelephonyManager {
* @param number The voicemail number.
*/
public boolean setVoiceMailNumber(String alphaTag, String number) {
return setVoiceMailNumber(getDefaultSubscription(), alphaTag, number);
return setVoiceMailNumber(getSubId(), alphaTag, number);
}
/**
@@ -2416,6 +2455,7 @@ public class TelephonyManager {
* @param subId The subscription id.
* @param alphaTag The alpha tag to display.
* @param number The voicemail number.
* @hide
*/
public boolean setVoiceMailNumber(int subId, String alphaTag, String number) {
try {
@@ -2533,7 +2573,7 @@ public class TelephonyManager {
* @hide
*/
public int getVoiceMessageCount() {
return getVoiceMessageCount(getDefaultSubscription());
return getVoiceMessageCount(getSubId());
}
/**
@@ -2542,8 +2582,8 @@ public class TelephonyManager {
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @param subId whose voice message count is returned
* @hide
*/
/** {@hide} */
public int getVoiceMessageCount(int subId) {
try {
ITelephony telephony = getITelephony();
@@ -2566,7 +2606,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
public String getVoiceMailAlphaTag() {
return getVoiceMailAlphaTag(getDefaultSubscription());
return getVoiceMailAlphaTag(getSubId());
}
/**
@@ -2577,6 +2617,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @param subId whose alphabetic identifier associated with the
* voice mail number is returned
* @hide
*/
public String getVoiceMailAlphaTag(int subId) {
try {
@@ -2694,6 +2735,7 @@ public class TelephonyManager {
* for a subscription.
*
* @param subId whose call state is returned
* @hide
*/
public int getCallState(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId);
@@ -2863,7 +2905,7 @@ public class TelephonyManager {
* @hide
*/
public int getCdmaEriIconIndex() {
return getCdmaEriIconIndex(getDefaultSubscription());
return getCdmaEriIconIndex(getSubId());
}
/**
@@ -2871,8 +2913,8 @@ public class TelephonyManager {
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
/** {@hide} */
public int getCdmaEriIconIndex(int subId) {
try {
ITelephony telephony = getITelephony();
@@ -2898,7 +2940,7 @@ public class TelephonyManager {
* @hide
*/
public int getCdmaEriIconMode() {
return getCdmaEriIconMode(getDefaultSubscription());
return getCdmaEriIconMode(getSubId());
}
/**
@@ -2909,8 +2951,8 @@ public class TelephonyManager {
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
/** {@hide} */
public int getCdmaEriIconMode(int subId) {
try {
ITelephony telephony = getITelephony();
@@ -2934,7 +2976,7 @@ public class TelephonyManager {
* @hide
*/
public String getCdmaEriText() {
return getCdmaEriText(getDefaultSubscription());
return getCdmaEriText(getSubId());
}
/**
@@ -2943,8 +2985,8 @@ public class TelephonyManager {
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* @hide
*/
/** {@hide} */
public String getCdmaEriText(int subId) {
try {
ITelephony telephony = getITelephony();
@@ -3097,7 +3139,7 @@ public class TelephonyManager {
* @return an IccOpenLogicalChannelResponse object.
*/
public IccOpenLogicalChannelResponse iccOpenLogicalChannel(String AID) {
return iccOpenLogicalChannel(getDefaultSubscription(), AID);
return iccOpenLogicalChannel(getSubId(), AID);
}
/**
@@ -3112,6 +3154,7 @@ public class TelephonyManager {
* @param subId The subscription to use.
* @param AID Application id. See ETSI 102.221 and 101.220.
* @return an IccOpenLogicalChannelResponse object.
* @hide
*/
public IccOpenLogicalChannelResponse iccOpenLogicalChannel(int subId, String AID) {
try {
@@ -3138,7 +3181,7 @@ public class TelephonyManager {
* @return true if the channel was closed successfully.
*/
public boolean iccCloseLogicalChannel(int channel) {
return iccCloseLogicalChannel(getDefaultSubscription(), channel);
return iccCloseLogicalChannel(getSubId(), channel);
}
/**
@@ -3154,6 +3197,7 @@ public class TelephonyManager {
* @param channel is the channel id to be closed as retruned by a successful
* iccOpenLogicalChannel.
* @return true if the channel was closed successfully.
* @hide
*/
public boolean iccCloseLogicalChannel(int subId, int channel) {
try {
@@ -3189,7 +3233,7 @@ public class TelephonyManager {
*/
public String iccTransmitApduLogicalChannel(int channel, int cla,
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);
}
@@ -3214,6 +3258,7 @@ public class TelephonyManager {
* @param data Data to be sent with the APDU.
* @return The APDU response from the ICC card with the status appended at
* the end.
* @hide
*/
public String iccTransmitApduLogicalChannel(int subId, int channel, int cla,
int instruction, int p1, int p2, int p3, String data) {
@@ -3249,7 +3294,7 @@ public class TelephonyManager {
*/
public String iccTransmitApduBasicChannel(int cla,
int instruction, int p1, int p2, int p3, String data) {
return iccTransmitApduBasicChannel(getDefaultSubscription(), cla,
return iccTransmitApduBasicChannel(getSubId(), cla,
instruction, p1, p2, p3, data);
}
@@ -3272,6 +3317,7 @@ public class TelephonyManager {
* @param data Data to be sent with the APDU.
* @return The APDU response from the ICC card with the status appended at
* the end.
* @hide
*/
public String iccTransmitApduBasicChannel(int subId, int cla,
int instruction, int p1, int p2, int p3, String data) {
@@ -3303,7 +3349,7 @@ public class TelephonyManager {
*/
public byte[] iccExchangeSimIO(int fileID, int command, int p1, int p2, int p3,
String filePath) {
return iccExchangeSimIO(getDefaultSubscription(), fileID, command, p1, p2, p3, filePath);
return iccExchangeSimIO(getSubId(), fileID, command, p1, p2, p3, filePath);
}
/**
@@ -3321,6 +3367,7 @@ public class TelephonyManager {
* @param p3 P3 value of the APDU command.
* @param filePath
* @return The APDU response.
* @hide
*/
public byte[] iccExchangeSimIO(int subId, int fileID, int command, int p1, int p2,
int p3, String filePath) {
@@ -3349,7 +3396,7 @@ public class TelephonyManager {
* returns an empty string.
*/
public String sendEnvelopeWithStatus(String content) {
return sendEnvelopeWithStatus(getDefaultSubscription(), content);
return sendEnvelopeWithStatus(getSubId(), content);
}
/**
@@ -3366,6 +3413,7 @@ public class TelephonyManager {
* @return The APDU response from the ICC card in hexadecimal format
* with the last 4 bytes being the status word. If the command fails,
* returns an empty string.
* @hide
*/
public String sendEnvelopeWithStatus(int subId, String content) {
try {
@@ -3484,6 +3532,19 @@ public class TelephonyManager {
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.
*/
@@ -3766,7 +3827,7 @@ public class TelephonyManager {
* @see #hasCarrierPrivileges
*/
public String getIccAuthentication(int appType, int authType, String data) {
return getIccAuthentication(getDefaultSubscription(), appType, authType, data);
return getIccAuthentication(getSubId(), appType, authType, data);
}
/**
@@ -3784,8 +3845,8 @@ public class TelephonyManager {
* @return the response of authentication, or null if not available
*
* @see #hasCarrierPrivileges
* @hide
*/
public String getIccAuthentication(int subId, int appType, int authType, String data) {
try {
IPhoneSubInfo info = getSubscriberInfo();
@@ -3864,6 +3925,7 @@ public class TelephonyManager {
* Or the calling app has carrier privileges. @see #hasCarrierPrivileges
*
* @hide
* TODO: Add an overload that takes no args.
*/
public void setNetworkSelectionModeAutomatic(int subId) {
try {
@@ -3889,6 +3951,7 @@ public class TelephonyManager {
* Or the calling app has carrier privileges. @see #hasCarrierPrivileges
*
* @hide
* TODO: Add an overload that takes no args.
*/
public CellNetworkScanResult getCellNetworkScanResults(int subId) {
try {
@@ -3912,6 +3975,7 @@ public class TelephonyManager {
* Or the calling app has carrier privileges. @see #hasCarrierPrivileges
*
* @hide
* TODO: Add an overload that takes no args.
*/
public boolean setNetworkSelectionModeManual(int subId, OperatorInfo operator,
boolean persistSelection) {
@@ -3963,7 +4027,7 @@ public class TelephonyManager {
* @return true on success; false on any failure.
*/
public boolean setPreferredNetworkTypeToGlobal() {
return setPreferredNetworkTypeToGlobal(getDefaultSubscription());
return setPreferredNetworkTypeToGlobal(getSubId());
}
/**
@@ -3974,6 +4038,7 @@ public class TelephonyManager {
* @see #hasCarrierPrivileges
*
* @return true on success; false on any failure.
* @hide
*/
public boolean setPreferredNetworkTypeToGlobal(int subId) {
return setPreferredNetworkType(subId, RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA);
@@ -4023,7 +4088,7 @@ public class TelephonyManager {
* @return true if the app has carrier privileges.
*/
public boolean hasCarrierPrivileges() {
return hasCarrierPrivileges(getDefaultSubscription());
return hasCarrierPrivileges(getSubId());
}
/**
@@ -4035,12 +4100,13 @@ public class TelephonyManager {
*
* @param subId The subscription to use.
* @return true if the app has carrier privileges.
* @hide
*/
public boolean hasCarrierPrivileges(int subId) {
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
return telephony.getCarrierPrivilegeStatus(subId) ==
return telephony.getCarrierPrivilegeStatus(mSubId) ==
CARRIER_PRIVILEGE_STATUS_HAS_ACCESS;
}
} catch (RemoteException ex) {
@@ -4066,7 +4132,7 @@ public class TelephonyManager {
* @return true if the operation was executed correctly.
*/
public boolean setOperatorBrandOverride(String brand) {
return setOperatorBrandOverride(getDefaultSubscription(), brand);
return setOperatorBrandOverride(getSubId(), brand);
}
/**
@@ -4083,6 +4149,7 @@ public class TelephonyManager {
* @param subId The subscription to use.
* @param brand The brand name to display/set.
* @return true if the operation was executed correctly.
* @hide
*/
public boolean setOperatorBrandOverride(int subId, String brand) {
try {
@@ -4119,7 +4186,7 @@ public class TelephonyManager {
public boolean setRoamingOverride(List<String> gsmRoamingList,
List<String> gsmNonRoamingList, List<String> cdmaRoamingList,
List<String> cdmaNonRoamingList) {
return setRoamingOverride(getDefaultSubscription(), gsmRoamingList, gsmNonRoamingList,
return setRoamingOverride(getSubId(), gsmRoamingList, gsmNonRoamingList,
cdmaRoamingList, cdmaNonRoamingList);
}
@@ -4166,7 +4233,7 @@ public class TelephonyManager {
/** @hide */
@SystemApi
public String getCdmaMdn() {
return getCdmaMdn(getDefaultSubscription());
return getCdmaMdn(getSubId());
}
/** @hide */
@@ -4187,7 +4254,7 @@ public class TelephonyManager {
/** @hide */
@SystemApi
public String getCdmaMin() {
return getCdmaMin(getDefaultSubscription());
return getCdmaMin(getSubId());
}
/** @hide */
@@ -4730,7 +4797,8 @@ public class TelephonyManager {
* retrieves value for setting "name", and if that is not found throws
* SettingNotFoundException
*
* @hide */
* @hide
*/
public static int getIntWithSubId(ContentResolver cr, String name, int subId)
throws SettingNotFoundException {
try {