Merge "Added slot index version of getNetworkCountryIso"
am: 4d854986f3
Change-Id: I79362cea8c0361ad1d767cc4a01a49e446c65d38
This commit is contained in:
@@ -44925,6 +44925,7 @@ package android.telephony {
|
|||||||
field public static final int DATA_ROAMING_DISABLE = 0; // 0x0
|
field public static final int DATA_ROAMING_DISABLE = 0; // 0x0
|
||||||
field public static final int DATA_ROAMING_ENABLE = 1; // 0x1
|
field public static final int DATA_ROAMING_ENABLE = 1; // 0x1
|
||||||
field public static final int DEFAULT_SUBSCRIPTION_ID = 2147483647; // 0x7fffffff
|
field public static final int DEFAULT_SUBSCRIPTION_ID = 2147483647; // 0x7fffffff
|
||||||
|
field public static final String EXTRA_SLOT_INDEX = "android.telephony.extra.SLOT_INDEX";
|
||||||
field public static final String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX";
|
field public static final String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX";
|
||||||
field public static final int INVALID_SIM_SLOT_INDEX = -1; // 0xffffffff
|
field public static final int INVALID_SIM_SLOT_INDEX = -1; // 0xffffffff
|
||||||
field public static final int INVALID_SUBSCRIPTION_ID = -1; // 0xffffffff
|
field public static final int INVALID_SUBSCRIPTION_ID = -1; // 0xffffffff
|
||||||
|
|||||||
@@ -8190,6 +8190,7 @@ package android.telephony {
|
|||||||
method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst();
|
method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst();
|
||||||
method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.Map<java.lang.Integer,java.lang.Integer> getLogicalToPhysicalSlotMapping();
|
method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.Map<java.lang.Integer,java.lang.Integer> getLogicalToPhysicalSlotMapping();
|
||||||
method public static long getMaxNumberVerificationTimeoutMillis();
|
method public static long getMaxNumberVerificationTimeoutMillis();
|
||||||
|
method @NonNull public String getNetworkCountryIso(int);
|
||||||
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getPreferredNetworkTypeBitmask();
|
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getPreferredNetworkTypeBitmask();
|
||||||
method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public int getRadioPowerState();
|
method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public int getRadioPowerState();
|
||||||
method public int getSimApplicationState();
|
method public int getSimApplicationState();
|
||||||
|
|||||||
@@ -2900,6 +2900,7 @@ package android.telephony {
|
|||||||
method public int checkCarrierPrivilegesForPackage(String);
|
method public int checkCarrierPrivilegesForPackage(String);
|
||||||
method public int getCarrierIdListVersion();
|
method public int getCarrierIdListVersion();
|
||||||
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getLine1AlphaTag();
|
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getLine1AlphaTag();
|
||||||
|
method @NonNull public String getNetworkCountryIso(int);
|
||||||
method public android.util.Pair<java.lang.Integer,java.lang.Integer> getRadioHalVersion();
|
method public android.util.Pair<java.lang.Integer,java.lang.Integer> getRadioHalVersion();
|
||||||
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void refreshUiccProfile();
|
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void refreshUiccProfile();
|
||||||
method @Deprecated public void setCarrierTestOverride(String, String, String, String, String, String, String);
|
method @Deprecated public void setCarrierTestOverride(String, String, String, String, String, String, String);
|
||||||
|
|||||||
@@ -895,6 +895,11 @@ public class SubscriptionManager {
|
|||||||
*/
|
*/
|
||||||
public static final String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX";
|
public static final String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Integer extra to specify SIM slot index.
|
||||||
|
*/
|
||||||
|
public static final String EXTRA_SLOT_INDEX = "android.telephony.extra.SLOT_INDEX";
|
||||||
|
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private volatile INetworkPolicyManager mNetworkPolicy;
|
private volatile INetworkPolicyManager mNetworkPolicy;
|
||||||
|
|
||||||
@@ -2122,6 +2127,7 @@ public class SubscriptionManager {
|
|||||||
if (VDBG) logd("putPhoneIdAndSubIdExtra: phoneId=" + phoneId + " subId=" + subId);
|
if (VDBG) logd("putPhoneIdAndSubIdExtra: phoneId=" + phoneId + " subId=" + subId);
|
||||||
intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId);
|
intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId);
|
||||||
intent.putExtra(EXTRA_SUBSCRIPTION_INDEX, subId);
|
intent.putExtra(EXTRA_SUBSCRIPTION_INDEX, subId);
|
||||||
|
intent.putExtra(EXTRA_SLOT_INDEX, phoneId);
|
||||||
intent.putExtra(PhoneConstants.PHONE_KEY, phoneId);
|
intent.putExtra(PhoneConstants.PHONE_KEY, phoneId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2499,41 +2499,37 @@ public class TelephonyManager {
|
|||||||
* @return the lowercase 2 character ISO-3166 country code, or empty string if not available.
|
* @return the lowercase 2 character ISO-3166 country code, or empty string if not available.
|
||||||
*/
|
*/
|
||||||
public String getNetworkCountryIso() {
|
public String getNetworkCountryIso() {
|
||||||
return getNetworkCountryIsoForPhone(getPhoneId());
|
return getNetworkCountryIso(getPhoneId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the ISO country code equivalent of the MCC (Mobile Country Code) of the current
|
* Returns the ISO-3166 country code equivalent of the MCC (Mobile Country Code) of the current
|
||||||
* registered operator or the cell nearby, if available.
|
* registered operator or the cell nearby, if available.
|
||||||
* <p>
|
* <p>
|
||||||
|
* The ISO-3166 country code is provided in lowercase 2 character format.
|
||||||
|
* <p>
|
||||||
|
* Note: In multi-sim, this returns a shared emergency network country iso from other
|
||||||
|
* subscription if the subscription used to create the TelephonyManager doesn't camp on
|
||||||
|
* a network due to some reason (e.g. pin/puk locked), or sim is absent in the corresponding
|
||||||
|
* slot.
|
||||||
* Note: Result may be unreliable on CDMA networks (use {@link #getPhoneType()} to determine
|
* Note: Result may be unreliable on CDMA networks (use {@link #getPhoneType()} to determine
|
||||||
* if on a CDMA network).
|
* if on a CDMA network).
|
||||||
*
|
|
||||||
* @param subId for which Network CountryIso is returned
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@UnsupportedAppUsage
|
|
||||||
public String getNetworkCountryIso(int subId) {
|
|
||||||
return getNetworkCountryIsoForPhone(getPhoneId(subId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the ISO country code equivalent of the current registered
|
|
||||||
* operator's MCC (Mobile Country Code) of a subscription.
|
|
||||||
* <p>
|
* <p>
|
||||||
* Availability: Only when user is registered to a network. Result may be
|
|
||||||
* unreliable on CDMA networks (use {@link #getPhoneType()} to determine if
|
|
||||||
* on a CDMA network).
|
|
||||||
*
|
*
|
||||||
* @param phoneId for which Network CountryIso is returned
|
* @param slotIndex the SIM slot index to get network country ISO.
|
||||||
|
*
|
||||||
|
* @return the lowercase 2 character ISO-3166 country code, or empty string if not available.
|
||||||
|
*
|
||||||
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
/** {@hide} */
|
@SystemApi
|
||||||
@UnsupportedAppUsage
|
@TestApi
|
||||||
public String getNetworkCountryIsoForPhone(int phoneId) {
|
@NonNull
|
||||||
|
public String getNetworkCountryIso(int slotIndex) {
|
||||||
try {
|
try {
|
||||||
ITelephony telephony = getITelephony();
|
ITelephony telephony = getITelephony();
|
||||||
if (telephony == null) return "";
|
if (telephony == null) return "";
|
||||||
return telephony.getNetworkCountryIsoForPhone(phoneId);
|
return telephony.getNetworkCountryIsoForPhone(slotIndex);
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user