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

Commit ed80f3f0 authored by Jim Miller's avatar Jim Miller
Browse files

Fix issue where keyguard reports a valid token but doesn't draw

This fixes an issue where keyguard isn't showing but tells
PhoneWindowManager to wait anyway.  The fix is to send a null token
when keyguard isn't showing.

Fixes bug 11216030

Change-Id: I4985fe50c63819415d9d5a1de0b741c8aa6391d8
parent f847c3b0
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -431,17 +431,13 @@ public class KeyguardViewManager {
    public synchronized void onScreenTurnedOn(final IKeyguardShowCallback callback) {
        if (DEBUG) Log.d(TAG, "onScreenTurnedOn()");
        mScreenOn = true;
        final IBinder token;

        // If keyguard is disabled, we need to inform PhoneWindowManager with a null
        // If keyguard is not showing, we need to inform PhoneWindowManager with a null
        // token so it doesn't wait for us to draw...
        final boolean disabled =
                mLockPatternUtils.isLockScreenDisabled() && !mLockPatternUtils.isSecure();
        if (mKeyguardHost == null || disabled) {
            token = null;
        } else {
            token = mKeyguardHost.getWindowToken();
        }
        final IBinder token = isShowing() ? mKeyguardHost.getWindowToken() : null;

        if (DEBUG && token == null) Slog.v(TAG, "send wm null token: "
                + (mKeyguardHost == null ? "host was null" : "not showing"));

        if (mKeyguardView != null) {
            mKeyguardView.onScreenTurnedOn();