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

Commit dd2f2343 authored by Jonathan Basseri's avatar Jonathan Basseri
Browse files

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: I64f31d111213281edeaeda6a09b163b860261b2d
(cherry picked from commit 83c25b8ce17c3ce387d87d5f36182645e686540e)
parent d1e586cf
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1654,8 +1654,7 @@ public class TelephonyManager {
     * @hide
     */
    public String getNetworkCountryIso(int subId) {
        int phoneId = SubscriptionManager.getPhoneId(subId);
        return getNetworkCountryIsoForPhone(phoneId);
        return getNetworkCountryIsoForPhone(getPhoneId(subId));
    }

    /**
@@ -1670,7 +1669,13 @@ 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.
     */