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

Commit 35c9f485 authored by Aaron Liu's avatar Aaron Liu Committed by Automerger Merge Worker
Browse files

Merge "Clean up PREVENT_BYPASS_KEYGUARD flag" into udc-dev am: f6bbf92b

parents c306fc21 f6bbf92b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -264,8 +264,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
         */
        @Override
        public void finish(boolean strongAuth, int targetUserId) {
            if (mFeatureFlags.isEnabled(Flags.PREVENT_BYPASS_KEYGUARD)
                    && !mKeyguardStateController.canDismissLockScreen() && !strongAuth) {
            if (!mKeyguardStateController.canDismissLockScreen() && !strongAuth) {
                Log.e(TAG,
                        "Tried to dismiss keyguard when lockscreen is not dismissible and user "
                                + "was not authenticated with a primary security method "
+0 −5
Original line number Diff line number Diff line
@@ -212,11 +212,6 @@ object Flags {
                    "wallpaper_picker_ui_for_aiwp"
            )

    /** Whether to inflate the bouncer view on a background thread. */
    // TODO(b/273341787): Tracking Bug
    @JvmField
    val PREVENT_BYPASS_KEYGUARD = releasedFlag(230, "prevent_bypass_keyguard")

    /** Whether to use a new data source for intents to run on keyguard dismissal. */
    @JvmField
    val REFACTOR_KEYGUARD_DISMISS_INTENT = unreleasedFlag(231, "refactor_keyguard_dismiss_intent")
+0 −22
Original line number Diff line number Diff line
@@ -64,7 +64,6 @@ import com.android.systemui.biometrics.SideFpsUiRequestSource;
import com.android.systemui.classifier.FalsingA11yDelegate;
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
import com.android.systemui.keyguard.domain.interactor.KeyguardFaceAuthInteractor;
import com.android.systemui.log.SessionTracker;
import com.android.systemui.plugins.ActivityStarter;
@@ -397,26 +396,6 @@ public class KeyguardSecurityContainerControllerTest extends SysuiTestCase {
        verify(mViewMediatorCallback).keyguardDone(anyBoolean(), anyInt());
    }

    @Test
    public void showNextSecurityScreenOrFinish_DeviceNotSecure_prevent_bypass_on() {
        when(mFeatureFlags.isEnabled(Flags.PREVENT_BYPASS_KEYGUARD)).thenReturn(true);
        // GIVEN the current security method is SimPin
        when(mKeyguardUpdateMonitor.getUserHasTrust(anyInt())).thenReturn(false);
        when(mKeyguardUpdateMonitor.getUserUnlockedWithBiometric(TARGET_USER_ID)).thenReturn(false);
        mKeyguardSecurityContainerController.showSecurityScreen(SecurityMode.SimPin);

        // WHEN a request is made from the SimPin screens to show the next security method
        when(mKeyguardSecurityModel.getSecurityMode(TARGET_USER_ID)).thenReturn(SecurityMode.None);
        mKeyguardSecurityContainerController.showNextSecurityScreenOrFinish(
                /* authenticated= */true,
                TARGET_USER_ID,
                /* bypassSecondaryLockScreen= */true,
                SecurityMode.SimPin);

        // THEN the next security method of None will dismiss keyguard.
        verify(mViewMediatorCallback).keyguardDone(anyBoolean(), anyInt());
    }

    @Test
    public void showNextSecurityScreenOrFinish_ignoresCallWhenSecurityMethodHasChanged() {
        //GIVEN current security mode has been set to PIN
@@ -608,7 +587,6 @@ public class KeyguardSecurityContainerControllerTest extends SysuiTestCase {

    @Test
    public void testSecurityCallbackFinish_cannotDismissLockScreenAndNotStrongAuth() {
        when(mFeatureFlags.isEnabled(Flags.PREVENT_BYPASS_KEYGUARD)).thenReturn(true);
        when(mKeyguardStateController.canDismissLockScreen()).thenReturn(false);
        mKeyguardSecurityContainerController.finish(false, 0);
        verify(mViewMediatorCallback, never()).keyguardDone(anyBoolean(), anyInt());