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

Commit 0ede222b authored by chen xu's avatar chen xu
Browse files

add two more parameters to carrier id TestAPI

Bug: 128441910
Test: atest GtsGmscoreHostTestCases:com.google.android.gts.telephony.TelephonyHostTest
Change-Id: Ida6201b632153acd04b1a224d9f31706cbcf1999
parent b3e90090
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2548,7 +2548,8 @@ package android.telephony {
    method public int getCarrierIdListVersion();
    method public android.util.Pair<java.lang.Integer,java.lang.Integer> getRadioHalVersion();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void refreshUiccProfile();
    method public void setCarrierTestOverride(String, String, String, String, String, String, String);
    method @Deprecated public void setCarrierTestOverride(String, String, String, String, String, String, String);
    method public void setCarrierTestOverride(String, String, String, String, String, String, String, String, String);
    field public static final int CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES = -2; // 0xfffffffe
    field public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS = 1; // 0x1
    field public static final int CARRIER_PRIVILEGE_STATUS_NO_ACCESS = 0; // 0x0
+32 −1
Original line number Diff line number Diff line
@@ -9857,8 +9857,11 @@ public class TelephonyManager {
     * <p>Requires Permission:
     *   {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
     *
     *
     * @deprecated
     * @hide
     */
    @Deprecated
    @TestApi
    public void setCarrierTestOverride(String mccmnc, String imsi, String iccid, String gid1,
            String gid2, String plmn, String spn) {
@@ -9866,7 +9869,35 @@ public class TelephonyManager {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                telephony.setCarrierTestOverride(
                        getSubId(), mccmnc, imsi, iccid, gid1, gid2, plmn, spn);
                        getSubId(), mccmnc, imsi, iccid, gid1, gid2, plmn, spn,
                        null, null);
            }
        } catch (RemoteException ex) {
            // This could happen if binder process crashes.
        }
    }

    /**
     * A test API to override carrier information including mccmnc, imsi, iccid, gid1, gid2,
     * plmn, spn, apn and carrier priviledge. This would be handy for, eg, forcing a particular
     * carrier id, carrier's config (also any country or carrier overlays) to be loaded when using
     * a test SIM with a call box.
     *
     * <p>Requires Permission:
     *   {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
     *
     * @hide
     */
    @TestApi
    public void setCarrierTestOverride(String mccmnc, String imsi, String iccid, String gid1,
                                       String gid2, String plmn, String spn,
                                       String carrierPriviledgeRules, String apn) {
        try {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                telephony.setCarrierTestOverride(
                        getSubId(), mccmnc, imsi, iccid, gid1, gid2, plmn, spn,
                        carrierPriviledgeRules, apn);
            }
        } catch (RemoteException ex) {
            // This could happen if binder process crashes.
+1 −1
Original line number Diff line number Diff line
@@ -1683,7 +1683,7 @@ interface ITelephony {
     * (also any country or carrier overlays) to be loaded when using a test SIM with a call box.
     */
    void setCarrierTestOverride(int subId, String mccmnc, String imsi, String iccid, String gid1,
            String gid2, String plmn, String spn);
            String gid2, String plmn, String spn, String carrierPrivilegeRules, String apn);

    /**
     * A test API to return installed carrier id list version.