Move getNetworkCountryIso impl from TM to PIM.

This moves the implementation of getNetworkCountryIso from
TelephonyManager into PhoneInterfaceManager so that we can perform an
additional IWLAN check.

Bug: 63050313
Test: no compilation errors
Change-Id: I8463af8ed427b73b57a4076c0ff79f055c697657
This commit is contained in:
Jonathan Basseri
2017-07-19 13:44:31 -07:00
parent c0a4f5357e
commit 6f4657363c
2 changed files with 16 additions and 3 deletions

View File

@@ -1613,8 +1613,7 @@ public class TelephonyManager {
* @hide
*/
public String getNetworkCountryIso(int subId) {
int phoneId = SubscriptionManager.getPhoneId(subId);
return getNetworkCountryIsoForPhone(phoneId);
return getNetworkCountryIsoForPhone(getPhoneId(subId));
}
/**
@@ -1629,7 +1628,14 @@ public class TelephonyManager {
*/
/** {@hide} */
public String getNetworkCountryIsoForPhone(int phoneId) {
return getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_OPERATOR_ISO_COUNTRY, "");
try {
ITelephony telephony = getITelephony();
if (telephony != null)
return "";
return telephony.getNetworkCountryIsoForPhone(phoneId);
} catch (RemoteException ex) {
return "";
}
}
/** Network type is unknown */

View File

@@ -376,6 +376,13 @@ interface ITelephony {
Bundle getCellLocation(String callingPkg);
/**
* Returns the ISO country code equivalent of the current registered
* operator's MCC (Mobile Country Code).
* @see android.telephony.TelephonyManager#getNetworkCountryIso
*/
String getNetworkCountryIsoForPhone(int phoneId);
/**
* Returns the neighboring cell information of the device.
*/