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

Commit 0df34fc6 authored by Jeff Davidson's avatar Jeff Davidson Committed by android-build-merger
Browse files

Bypass consent dialogs for privileged eUICC switches.

am: 2938f11d

Change-Id: Idaeb0b97fd9cc17ee8bf11d50c150c89ed8aaf6c
parents 54a3e691 2938f11d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -623,6 +623,13 @@ public class EuiccController extends IEuiccController.Stub {

        long token = Binder.clearCallingIdentity();
        try {
            if (callerCanWriteEmbeddedSubscriptions) {
                // Assume that if a privileged caller is calling us, we don't need to prompt the
                // user about changing carriers, because the caller would only be acting in response
                // to user action.
                forceDeactivateSim = true;
            }

            final String iccid;
            if (subscriptionId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
                // Switch to "no" subscription. Only the system can do this.
+0 −13
Original line number Diff line number Diff line
@@ -579,19 +579,6 @@ public class EuiccControllerTest extends TelephonyTest {
                42 /* detailedCode */);
    }

    @Test
    public void testSwitchToSubscription_mustDeactivateSim() throws Exception {
        setHasWriteEmbeddedPermission(true);
        prepareOperationSubscription(false /* hasPrivileges */);
        callSwitchToSubscription(
                SUBSCRIPTION_ID, ICC_ID, true /* complete */,
                EuiccService.RESULT_MUST_DEACTIVATE_SIM, "whatever" /* callingPackage */);
        verifyIntentSent(EuiccManager.EMBEDDED_SUBSCRIPTION_RESULT_RESOLVABLE_ERROR,
                0 /* detailedCode */);
        verifyResolutionIntent(EuiccService.ACTION_RESOLVE_DEACTIVATE_SIM,
                EuiccOperation.ACTION_SWITCH_DEACTIVATE_SIM);
    }

    @Test
    public void testSwitchToSubscription_success() throws Exception {
        setHasWriteEmbeddedPermission(true);