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

Commit e6074260 authored by Matt Garnes's avatar Matt Garnes
Browse files

Wait until the Keyguard is drawn to dismiss the boot dialog.

In a631d49e, we check that the keyguard is ready to avoid displaying the
homescreen before the keyguard if the boot message is dismissed too
soon. However, this only checked mKeyguardDrawnOnce, which is set to
true before the keyguard is fully visible to the user. Instead, wait for
mKeyguardDrawComplete, which will be triggered when the Keyguard is
actually fully visible.

With this change, the keyguard should always be the first thing displayed
after the boot dialog is dismissed, not the home screen.

Change-Id: I92f7df66e04613e9f9b39d293b190fc2473de176
(cherry picked from commit 1718ee0c)
parent 3f1b587c
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -347,7 +347,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    int[] mNavigationBarHeightForRotation = new int[4];
    int[] mNavigationBarWidthForRotation = new int[4];

    boolean mBootMessageNeedsHiding;
    KeyguardServiceDelegate mKeyguardDelegate;
    final Runnable mWindowManagerDrawCallback = new Runnable() {
        @Override
@@ -361,6 +360,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        public void onShown(IBinder windowToken) {
            if (DEBUG_WAKEUP) Slog.d(TAG, "mKeyguardDelegate.ShowListener.onShown.");
            mHandler.sendEmptyMessage(MSG_KEYGUARD_DRAWN_COMPLETE);
            hideBootMessages();
        }
    };

@@ -6123,10 +6123,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            if (!mKeyguardDrawnOnce && mAwake) {
                mKeyguardDrawnOnce = true;
                enableScreen = true;
                if (mBootMessageNeedsHiding) {
                    mBootMessageNeedsHiding = false;
                    hideBootMessages();
                }
            } else {
                enableScreen = false;
            }
@@ -6146,9 +6142,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {

    private void handleHideBootMessage() {
        synchronized (mLock) {
            if (!mKeyguardDrawnOnce) {
                mBootMessageNeedsHiding = true;
                return; // keyguard hasn't drawn the first time yet, not done booting
            if (!mKeyguardDrawComplete) {
                return; // keyguard hasn't completed drawing, not done booting.
            }
        }