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

Commit 0b9d8acc authored by Jim Miller's avatar Jim Miller
Browse files

Delay tearing down external displays until keyguard finishes

This waits until the keyguard window is actually removed before turning
off external presentations to avoid flashing the user's password.

Fixes bug 11562369

Change-Id: I74bfc0d5e23dccc5a8628abfe02868c71c371f6e
parent 3192148f
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -61,9 +61,11 @@ import android.widget.FrameLayout;
public class KeyguardViewManager {
    private final static boolean DEBUG = KeyguardViewMediator.DEBUG;
    private static String TAG = "KeyguardViewManager";
    public static boolean USE_UPPER_CASE = true;
    public final static String IS_SWITCHING_USER = "is_switching_user";

    // Delay dismissing keyguard to allow animations to complete.
    private static final int HIDE_KEYGUARD_DELAY = 500;

    // Timeout used for keypresses
    static final int DIGIT_PRESS_WAKE_MILLIS = 5000;

@@ -509,9 +511,10 @@ public class KeyguardViewManager {
                            mKeyguardHost.setCustomBackground(null);
                            updateShowWallpaper(true);
                            mKeyguardHost.removeView(lastView);
                            mViewMediatorCallback.keyguardGone();
                        }
                    }
                }, 500);
                }, HIDE_KEYGUARD_DELAY);
            }
        }
    }
+10 −1
Original line number Diff line number Diff line
@@ -309,6 +309,11 @@ public class KeyguardViewMediator {
         * Report that the keyguard is dismissable, pending the next keyguardDone call.
         */
        void keyguardDonePending();

        /**
         * Report when keyguard is actually gone
         */
        void keyguardGone();
    }

    KeyguardUpdateMonitorCallback mUpdateCallback = new KeyguardUpdateMonitorCallback() {
@@ -462,6 +467,11 @@ public class KeyguardViewMediator {
        public void keyguardDonePending() {
            mKeyguardDonePending = true;
        }

        @Override
        public void keyguardGone() {
            mKeyguardDisplayManager.hide();
        }
    };

    private void userActivity() {
@@ -1248,7 +1258,6 @@ public class KeyguardViewMediator {
            mKeyguardDonePending = false;
            updateActivityLockScreenState();
            adjustStatusBarLocked();
            mKeyguardDisplayManager.hide();
        }
    }