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

Commit ba7001c9 authored by Jack Yu's avatar Jack Yu Committed by android-build-merger
Browse files

Merge "Set country code even when device is not registered on network"

am: fc9bc10d

Change-Id: If3f257f00bcc4147e7d4cc85fdfe03b00b319d76
parents e0d33bc3 fc9bc10d
Loading
Loading
Loading
Loading
+9 −35
Original line number Original line Diff line number Diff line
@@ -1810,24 +1810,23 @@ public class TelephonyManager {
    }
    }


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


    /**
    /**
     * Returns the ISO country code equivalent of the current registered
     * Returns the ISO country code equivalent of the MCC (Mobile Country Code) of the current
     * operator's MCC (Mobile Country Code) of a subscription.
     * registered operator, or nearby cell information if not registered.
     * <p>
     * <p>
     * Availability: Only when user is registered to a network. Result may be
     * Note: Result may be unreliable on CDMA networks (use {@link #getPhoneType()} to determine
     * unreliable on CDMA networks (use {@link #getPhoneType()} to determine if
     * if on a CDMA network).
     * on a CDMA network).
     *
     *
     * @param subId for which Network CountryIso is returned
     * @param subId for which Network CountryIso is returned
     * @hide
     * @hide
@@ -7027,31 +7026,6 @@ public class TelephonyManager {
        }
        }
    }
    }


    /**
     * Set the ISO country code equivalent of the current registered
     * operator's MCC (Mobile Country Code).
     * @param iso the ISO country code equivalent of the current registered
     * @hide
     */
    public void setNetworkCountryIso(String iso) {
        int phoneId = getPhoneId();
        setNetworkCountryIsoForPhone(phoneId, iso);
    }

    /**
     * Set the ISO country code equivalent of the current registered
     * operator's MCC (Mobile Country Code).
     * @param phoneId which phone you want to set
     * @param iso the ISO country code equivalent of the current registered
     * @hide
     */
    public void setNetworkCountryIsoForPhone(int phoneId, String iso) {
        if (SubscriptionManager.isValidPhoneId(phoneId)) {
            setTelephonyProperty(phoneId,
                    TelephonyProperties.PROPERTY_OPERATOR_ISO_COUNTRY, iso);
        }
    }

    /**
    /**
     * Set the network type currently in use on the device for data transmission.
     * Set the network type currently in use on the device for data transmission.
     *
     *