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

Commit 65ee3064 authored by Jack Yu's avatar Jack Yu
Browse files

DO NOT MERGE - Set country code even when device is not registered on network

Extends the functionality of getNetworkCountryIso to support
no SIM/no service case. When no SIM/no service, it returns
the country code of nearby network (unregistered but cell info
is available to the device).

Test: Manual
Bug: 64335394
Change-Id: Ic7c9e903cc497b7e43b557cb593407ff3e9305b5
parent 51c1904b
Loading
Loading
Loading
Loading
+9 −10
Original line number Diff line number Diff line
@@ -1841,24 +1841,23 @@ public class TelephonyManager {
    }

    /**
     * Returns the ISO country code equivalent of the current registered
     * operator's MCC (Mobile Country Code).
     * Returns the ISO country code equivalent of the MCC (Mobile Country Code) of the current
     * registered operator, or nearby cell information if not registered.
     * .
     * <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).
     * Note: Result may be unreliable on CDMA networks (use {@link #getPhoneType()} to determine
     * if on a CDMA network).
     */
    public String getNetworkCountryIso() {
        return getNetworkCountryIsoForPhone(getPhoneId());
    }

    /**
     * Returns the ISO country code equivalent of the current registered
     * operator's MCC (Mobile Country Code) of a subscription.
     * Returns the ISO country code equivalent of the MCC (Mobile Country Code) of the current
     * registered operator, or nearby cell information if not registered.
     * <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).
     * Note: Result may be unreliable on CDMA networks (use {@link #getPhoneType()} to determine
     * if on a CDMA network).
     *
     * @param subId for which Network CountryIso is returned
     * @hide