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

Commit 71cb04bb 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
(cherry picked from commit 14f874de)
parent 94612df6
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -333,6 +333,7 @@ public class KeyguardService extends Service {
    };
    private final KeyguardServiceShowLockscreenInteractor mKeyguardServiceShowLockscreenInteractor;
    private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
    private final ActivityManager mActivityManager;

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

    @Override
@@ -684,6 +687,11 @@ public class KeyguardService extends Service {
        public void showDismissibleKeyguard() {
            trace("showDismissibleKeyguard");
            checkPermission();

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

            if (mFoldGracePeriodProvider.get().isEnabled()) {
                mKeyguardInteractor.showDismissibleKeyguard();
            }