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

Commit a6a3ebcd authored by Selim Cinek's avatar Selim Cinek
Browse files

Made sure to unlock the pending unlock if the user is being switched

Whenever the user switches and we still have a pending unlock, we
should not bypass anymore.

Bug: 134094877
Test: atest SystemUITests
Change-Id: I46e179748ecc7dc5e283fd7f0ef6c2968c5ae294
parent ec17775e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.hardware.face.FaceManager
import android.provider.Settings
import com.android.keyguard.KeyguardUpdateMonitor
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.statusbar.NotificationLockscreenUserManager
import com.android.systemui.statusbar.StatusBarState
import com.android.systemui.tuner.TunerService
import javax.inject.Inject
@@ -61,7 +62,8 @@ class KeyguardBypassController {

    @Inject
    constructor(context: Context, tunerService: TunerService,
                statusBarStateController: StatusBarStateController) {
                statusBarStateController: StatusBarStateController,
                lockscreenUserManager: NotificationLockscreenUserManager) {
        unlockMethodCache = UnlockMethodCache.getInstance(context)
        this.statusBarStateController = statusBarStateController
        statusBarStateController.addCallback(object : StatusBarStateController.StateListener {
@@ -88,6 +90,7 @@ class KeyguardBypassController {
                                        KeyguardUpdateMonitor.getCurrentUser()) != 0
            }
        }, Settings.Secure.FACE_UNLOCK_DISMISSES_KEYGUARD)
        lockscreenUserManager.addUserChangedListener { pendingUnlockType = null }
    }

    /**
+2 −1
Original line number Diff line number Diff line
@@ -112,7 +112,8 @@ public class NotificationPanelViewTest extends SysuiTestCase {
        mDependency.injectMockDependency(ConfigurationController.class);
        mDependency.injectMockDependency(ZenModeController.class);
        KeyguardBypassController bypassController = new KeyguardBypassController(mContext,
                mock(TunerService.class), mStatusBarStateController);
                mock(TunerService.class), mStatusBarStateController,
                mock(NotificationLockscreenUserManager.class));
        NotificationWakeUpCoordinator coordinator =
                new NotificationWakeUpCoordinator(mContext,
                        mock(HeadsUpManagerPhone.class),