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

Commit 2c8b12a1 authored by Calvin Pan's avatar Calvin Pan Committed by android-build-merger
Browse files

Merge "Create new API for MNO carrier id"

am: 7e74c4e4

Change-Id: I961e250ddb1f82526cd62a848b907657b6a8b260
parents 89d69159 7e74c4e4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2638,6 +2638,13 @@ public final class Telephony {
        public static final Uri ENFORCE_MANAGED_URI = Uri.parse(
                "content://telephony/carriers/enforce_managed");

        /**
         * The {@code content://} style URL to be called from Telephony to query current APNs.
         * @hide
         */
        public static final Uri SIM_APN_LIST = Uri.parse(
                "content://telephony/carriers/sim_apn_list");

        /**
         * The column name for ENFORCE_MANAGED_URI, indicates whether DPC-owned APNs are enforced.
         * @hide
+22 −0
Original line number Diff line number Diff line
@@ -8321,6 +8321,28 @@ public class TelephonyManager {
        return null;
    }

    /**
     * Returns MNO carrier id of the current subscription’s MCCMNC.
     * <p>MNO carrier id can be solely identified by subscription mccmnc. This is mainly used
     * for MNO fallback when exact carrier id {@link #getSimCarrierId()}
     * configurations are not found.
     *
     * @return MNO carrier id of the current subscription. Return the value same as carrier id
     * {@link #getSimCarrierId()}, if MNO carrier id cannot be identified.
     * @hide
     */
    public int getSimMNOCarrierId() {
        try {
            ITelephony service = getITelephony();
            if (service != null) {
                return service.getSubscriptionMNOCarrierId(getSubId());
            }
        } catch (RemoteException ex) {
            // This could happen if binder process crashes.
        }
        return UNKNOWN_CARRIER_ID;
    }

    /**
     * Return the application ID for the uicc application type like {@link #APPTYPE_CSIM}.
     * All uicc applications are uniquely identified by application ID. See ETSI 102.221 and 101.220
+12 −0
Original line number Diff line number Diff line
@@ -1310,6 +1310,18 @@ interface ITelephony {
     */
    String getSubscriptionCarrierName(int subId);

    /**
     * Returns MNO carrier id of the current subscription’s MCCMNC.
     * <p>MNO carrier id can be solely identified by subscription mccmnc. This is mainly used
     * for MNO fallback when exact carrier id {@link #getSimCarrierId()}
     * configurations are not found.
     *
     * @return MNO carrier id of the current subscription. Return the value same as carrier id
     * {@link #getSimCarrierId()}, if MNO carrier id cannot be identified.
     * @hide
     */
    int getSubscriptionMNOCarrierId(int subId);

    /**
     * Action set from carrier signalling broadcast receivers to enable/disable metered apns
     * Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required