From 0b9d8accc569d8b51fd76118ce2f069c24b9af90 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Thu, 7 Nov 2013 19:15:49 -0800 Subject: 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 --- .../src/com/android/keyguard/KeyguardViewManager.java | 7 +++++-- .../src/com/android/keyguard/KeyguardViewMediator.java | 11 ++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'packages/Keyguard') diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java index fd7cae6..6aa0a4b 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java @@ -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); } } } diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java index a1ff1f1..49982ea 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java @@ -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(); } } -- cgit v1.1