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

Commit 14f874de authored by Beverly's avatar Beverly Committed by Beverly Tai
Browse files

Don't show dismissible keyguard in app pinning mode

On foldables, if the "Continue using apps on fold" is set
to "Swipe up to continue", when closing the device,
a dismissible keyguard will show.

If this setting is set, and there's a pinned app, instead
of showing the dismissible keyguard on fold, we keep the
screen on with the app displayed.
This keeps the app pinned and in the same security state as
when it was unfolded.

Bug: 404252173
Flag: EXEMPT bugfix
Test: manually (given settings described above), pin app, fold;
observe app still shows with screen on

Change-Id: I61e2014b9d21862859090707e5531a61bf966fc3
parent 331b0529
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -327,6 +327,7 @@ public class KeyguardService extends Service {
    private final KeyguardDismissInteractor mKeyguardDismissInteractor;
    private final KeyguardServiceShowLockscreenInteractor mKeyguardServiceShowLockscreenInteractor;
    private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
    private final ActivityManager mActivityManager;

    @Inject
    public KeyguardService(
@@ -353,7 +354,8 @@ public class KeyguardService extends Service {
            Lazy<DeviceEntryInteractor> deviceEntryInteractorLazy,
            KeyguardStateCallbackInteractor keyguardStateCallbackInteractor,
            KeyguardServiceShowLockscreenInteractor keyguardServiceShowLockscreenInteractor,
            KeyguardUpdateMonitor keyguardUpdateMonitor) {
            KeyguardUpdateMonitor keyguardUpdateMonitor,
            ActivityManager activityManager) {
        super();
        mKeyguardViewMediator = keyguardViewMediator;
        mKeyguardLifecyclesDispatcher = keyguardLifecyclesDispatcher;
@@ -387,6 +389,7 @@ public class KeyguardService extends Service {
        mKeyguardDismissInteractor = keyguardDismissInteractor;
        mKeyguardServiceShowLockscreenInteractor = keyguardServiceShowLockscreenInteractor;
        mKeyguardUpdateMonitor = keyguardUpdateMonitor;
        mActivityManager = activityManager;
    }

    @Override
@@ -682,9 +685,12 @@ public class KeyguardService extends Service {
        public void showDismissibleKeyguard() {
            trace("showDismissibleKeyguard");
            checkPermission();
            mKeyguardInteractor.showDismissibleKeyguard();

            if (mActivityManager.getLockTaskModeState() != ActivityManager.LOCK_TASK_MODE_NONE) {
                return;
            }

            mKeyguardInteractor.showDismissibleKeyguard();
            if (KeyguardWmStateRefactor.isEnabled()) {
                mKeyguardServiceShowLockscreenInteractor.onKeyguardServiceShowDismissibleKeyguard();
            } else {