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

Commit b41821c6 authored by Rambo Wang's avatar Rambo Wang Committed by Android (Google) Code Review
Browse files

Merge "Turn off carrier privileges grace period feature"

parents 4f73d996 5e77304f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -108,11 +108,14 @@ public class CarrierPrivilegesTracker extends Handler {
    private static final String SHA_1 = "SHA-1";
    private static final String SHA_256 = "SHA-256";

    // TODO(b/232273884): Turn feature on when find solution to handle the inter-carriers switching
    /**
     * Time delay to clear UICC rules after UICC is gone.
     * This introduces the grace period to retain carrier privileges when SIM is removed.
     *
     * This feature is off by default due to the security concern during inter-carriers switching.
     */
    private static final long CLEAR_UICC_RULES_DELAY_MILLIS = TimeUnit.SECONDS.toMillis(30);
    private static final long CLEAR_UICC_RULES_DELAY_MILLIS = TimeUnit.SECONDS.toMillis(0);

    /**
     * PackageManager flags used to query installed packages.
+7 −3
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ import com.android.internal.telephony.uicc.IccUtils;

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InOrder;
@@ -549,7 +550,8 @@ public class CarrierPrivilegesTrackerTest extends TelephonyTest {
                List.of(new Pair<>(PRIVILEGED_PACKAGES, PRIVILEGED_UIDS_SET)));
    }

    @Test
    // TODO(b/232273884): turn UT case on when grace period is on
    @Ignore
    public void testSimStateChangedSimStateNotReady() throws Exception {
        // Start with privileges, verify clearing certs clears UIDs
        setupCarrierPrivilegesTrackerWithSimLoadedUids();
@@ -573,7 +575,8 @@ public class CarrierPrivilegesTrackerTest extends TelephonyTest {
                        new Pair<>(Set.of(), Set.of())));
    }

    @Test
    // TODO(b/232273884): turn UT case on when grace period is on
    @Ignore
    public void testSimStateChangedSimStateAbsentThenLoadedWithSameRules() throws Exception {
        // Start with privileges
        setupCarrierPrivilegesTrackerWithSimLoadedUids();
@@ -642,7 +645,8 @@ public class CarrierPrivilegesTrackerTest extends TelephonyTest {
                List.of(new Pair<>(Set.of(), Set.of())));
    }

    @Test
    // TODO(b/232273884): turn UT case on when grace period is on
    @Ignore
    public void testSimStateChangedSimStateAbsentThenLoadedWithUpdatedRules() throws Exception {
        // Start with privileges
        setupCarrierPrivilegesTrackerWithSimLoadedUids();