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

Commit 2c0d6dcc authored by Tony Mak's avatar Tony Mak
Browse files

No keyguard should be shown after reboot if it is in kiosk mode

1. we disable keyguard before KeyguardServiceDelegate connect the
   KeyGuardService and the request is ignored. We now remember the request
   and redo it after connected

2. Instead of checking PRIVATE_FLAG_KEYGUARD flag, use
   isKeyguardShowingAndNotOccluded to check is keyguard showing.

Bug: 28164604
Change-Id: Ib02b5fc9dcc6e8d9934309f1e540ece4d845363d
parent f9ffff1f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1133,6 +1133,11 @@ public interface WindowManagerPolicy {
     */
    public boolean isKeyguardShowingOrOccluded();

    /**
     * @return true if in keyguard is on and not occluded.
     */
    public boolean isKeyguardShowingAndNotOccluded();

    /**
     * inKeyguardRestrictedKeyInputMode
     *
+2 −1
Original line number Diff line number Diff line
@@ -6270,7 +6270,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }
    }

    private boolean isKeyguardShowingAndNotOccluded() {
    @Override
    public boolean isKeyguardShowingAndNotOccluded() {
        if (mKeyguardDelegate == null) return false;
        return mKeyguardDelegate.isShowing() && !mKeyguardOccluded;
    }
+4 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ public class KeyguardServiceDelegate {
            showingAndNotOccluded = true;
            secure = true;
            deviceHasKeyguard = true;
            enabled = true;
        }
        boolean showing;
        boolean showingAndNotOccluded;
@@ -177,6 +178,9 @@ public class KeyguardServiceDelegate {
            if (mKeyguardState.occluded) {
                mKeyguardService.setOccluded(mKeyguardState.occluded);
            }
            if (!mKeyguardState.enabled) {
                mKeyguardService.setKeyguardEnabled(mKeyguardState.enabled);
            }
        }

        @Override
+1 −1
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ public class WindowAnimator {
                    continue;
                }
                final WindowStateAnimator winAnimator = win.mWinAnimator;
                if ((win.mAttrs.privateFlags & PRIVATE_FLAG_KEYGUARD) != 0) {
                if (mPolicy.isKeyguardShowingAndNotOccluded()) {
                    if (!winAnimator.mAnimating) {
                        if (DEBUG_KEYGUARD) Slog.d(TAG,
                                "updateWindowsLocked: creating delay animation");