diff options
author | Jim Miller <jaggies@google.com> | 2009-10-07 01:30:21 -0700 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2009-10-08 17:55:05 -0700 |
commit | eb44da5077ae21571f39bae86d6be49b74c68e24 (patch) | |
tree | 13a173c3c6caed311f7b51df8cebf89974bb7b7e | |
parent | f184c68119489aa00eccba41d3babedce282518b (diff) | |
download | base-android-sdk-2.0_r1.tar.gz |
Cherry-pick from mr2 to eclair: DO NOT MERGEandroid-sdk-tools_r4android-sdk-tools_r3android-sdk-2.0_r1android-2.0_r1
commit 149c0543a3d5f450686b7c3d142ac5f8fcf61ed4
BUG=2176949
Partial fix for 2069703: Fix race condition in KeyguardViewManager.hide() that could result in a blank screen.
This fixes a race condition seen whenever show() is called before the timer in hide() triggers. This can happen
for example if the user hits "Emergency Dial" followed by the back button before the 0.5s timeout completes. The result
is a blank screen with no keyguard view and no means to recover on devices w/o a keyboard.
The bug caused us to sometimes remove the newly created KeyguardView instead of the old one, leaving the view empty.
The fix is to always remove the last view.
-rw-r--r-- | phone/com/android/internal/policy/impl/KeyguardViewManager.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/phone/com/android/internal/policy/impl/KeyguardViewManager.java b/phone/com/android/internal/policy/impl/KeyguardViewManager.java index 910df8d..bac2fca 100644 --- a/phone/com/android/internal/policy/impl/KeyguardViewManager.java +++ b/phone/com/android/internal/policy/impl/KeyguardViewManager.java @@ -48,7 +48,7 @@ public class KeyguardViewManager implements KeyguardWindowController { private WindowManager.LayoutParams mWindowLayoutParams; private boolean mNeedsInput = false; - + private FrameLayout mKeyguardHost; private KeyguardViewBase mKeyguardView; @@ -154,7 +154,7 @@ public class KeyguardViewManager implements KeyguardWindowController { mViewManager.updateViewLayout(mKeyguardHost, mWindowLayoutParams); } } - + /** * Reset the state of the view. */ @@ -218,15 +218,13 @@ public class KeyguardViewManager implements KeyguardWindowController { // Don't do this right away, so we can let the view continue to animate // as it goes away. if (mKeyguardView != null) { - final View lastView = mKeyguardView; + final KeyguardViewBase lastView = mKeyguardView; + mKeyguardView = null; mKeyguardHost.postDelayed(new Runnable() { public void run() { synchronized (KeyguardViewManager.this) { - if (mKeyguardView == lastView) { - mKeyguardHost.removeView(mKeyguardView); - mKeyguardView.cleanUp(); - mKeyguardView = null; - } + mKeyguardHost.removeView(lastView); + lastView.cleanUp(); } } }, 500); |