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

Commit e785ffa0 authored by tingna_sung's avatar tingna_sung Committed by Wale Ogunwale
Browse files

Should reset mDismissKeyguard on keyguard secure change

If user sets a non-secure lock screen, launch an activity which
appends window flag FLAG_DISMISS_KEYGUARD, then insert a PIN lock
SIM card, activity window will become black screen.

This is because mDismissKeyguard keeps on DISMISS_KEYGUARD_CONTINUE
when keyguard secure changes from non-secure to secure like in the
insert PIN lock SIM card case. If mDismissKeyguard is
DISMISS_KEYGUARD_CONTINUE and keyguard is secure, there is no chance
to launch keyguard unlock window anymore.

This patch handles the use case that to reset mDismissKeyguard to a
new cycle from DISMISS_KEYGUARD_START to DISMISS_KEYGUARD_CONTINUE
again once keyguard secure state change suddenly to let keyguard
window has chance to be launched.

https://code.google.com/p/android/issues/detail?id=78806



Change-Id: I0d4fd0b9bdf7d0a39f35427bfd4e1b928d9bca6b
Signed-off-by: default avatartingna_sung <tingna_sung@htc.com>

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
parent 55b4b2d5
Loading
Loading
Loading
Loading
+11 −2
Original line number Original line Diff line number Diff line
@@ -495,6 +495,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
     * be done once per window. */
     * be done once per window. */
    private WindowState mWinDismissingKeyguard;
    private WindowState mWinDismissingKeyguard;


    /** When window is currently dismissing the keyguard, dismissing the keyguard must handle
     * the keygaurd secure state change instantly case, e.g. the use case of inserting a PIN
     * lock SIM card. This variable is used to record the previous keyguard secure state for
     * monitoring secure state change on window dismissing keyguard. */
    private boolean mSecureDismissingKeyguard;

    /** The window that is currently showing "over" the keyguard. If there is an app window
    /** The window that is currently showing "over" the keyguard. If there is an app window
     * belonging to another app on top of this the keyguard shows. If there is a fullscreen
     * belonging to another app on top of this the keyguard shows. If there is a fullscreen
     * app window under this, still dismiss the keyguard but don't show the app underneath. Show
     * app window under this, still dismiss the keyguard but don't show the app underneath. Show
@@ -4238,9 +4244,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                            mDismissKeyguard == DISMISS_KEYGUARD_NONE) {
                            mDismissKeyguard == DISMISS_KEYGUARD_NONE) {
                        if (DEBUG_LAYOUT) Slog.v(TAG,
                        if (DEBUG_LAYOUT) Slog.v(TAG,
                                "Setting mDismissKeyguard true by win " + win);
                                "Setting mDismissKeyguard true by win " + win);
                        mDismissKeyguard = mWinDismissingKeyguard == win ?
                        mDismissKeyguard = (mWinDismissingKeyguard == win
                                DISMISS_KEYGUARD_CONTINUE : DISMISS_KEYGUARD_START;
                                && mSecureDismissingKeyguard == mKeyguardSecure)
                                ? DISMISS_KEYGUARD_CONTINUE : DISMISS_KEYGUARD_START;
                        mWinDismissingKeyguard = win;
                        mWinDismissingKeyguard = win;
                        mSecureDismissingKeyguard = mKeyguardSecure;
                        mForceStatusBarFromKeyguard = mShowingLockscreen && mKeyguardSecure;
                        mForceStatusBarFromKeyguard = mShowingLockscreen && mKeyguardSecure;
                    } else if (mAppsToBeHidden.isEmpty() && showWhenLocked) {
                    } else if (mAppsToBeHidden.isEmpty() && showWhenLocked) {
                        if (DEBUG_LAYOUT) Slog.v(TAG,
                        if (DEBUG_LAYOUT) Slog.v(TAG,
@@ -4426,6 +4434,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                }
                }
            } else {
            } else {
                mWinDismissingKeyguard = null;
                mWinDismissingKeyguard = null;
                mSecureDismissingKeyguard = false;
                mKeyguardHidden = false;
                mKeyguardHidden = false;
                if (setKeyguardOccludedLw(false)) {
                if (setKeyguardOccludedLw(false)) {
                    changes |= FINISH_LAYOUT_REDO_LAYOUT
                    changes |= FINISH_LAYOUT_REDO_LAYOUT