Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89a2a415 authored by Jonathan Basseri's avatar Jonathan Basseri Committed by android-build-merger
Browse files

Merge "Move getNetworkCountryIso impl from TM to PIM." am: 58bbef15 am: 02cc8151

am: aaeca1e9

Change-Id: I9935e8825683fb23fc03e38a93380add8fe4408a
parents 4e051d9d aaeca1e9
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -1642,8 +1642,7 @@ public class TelephonyManager {
     * @hide
     */
    public String getNetworkCountryIso(int subId) {
        int phoneId = SubscriptionManager.getPhoneId(subId);
        return getNetworkCountryIsoForPhone(phoneId);
        return getNetworkCountryIsoForPhone(getPhoneId(subId));
    }

    /**
@@ -1658,7 +1657,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 */
+7 −0
Original line number Diff line number Diff line
@@ -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.
     */