Loading src/java/com/android/internal/telephony/CarrierPrivilegesTracker.java +4 −1 Original line number Diff line number Diff line Loading @@ -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. Loading tests/telephonytests/src/com/android/internal/telephony/CarrierPrivilegesTrackerTest.java +7 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(); Loading @@ -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(); Loading Loading @@ -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(); Loading Loading
src/java/com/android/internal/telephony/CarrierPrivilegesTracker.java +4 −1 Original line number Diff line number Diff line Loading @@ -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. Loading
tests/telephonytests/src/com/android/internal/telephony/CarrierPrivilegesTrackerTest.java +7 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(); Loading @@ -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(); Loading Loading @@ -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(); Loading