am 3e1ae648: Fix potential race when removing keyguard view.

Merge commit '3e1ae648d66e3eaa7da6187b6afdbe95d902dbef'

* commit '3e1ae648d66e3eaa7da6187b6afdbe95d902dbef':
  Fix potential race when removing keyguard view.
This commit is contained in:
Dianne Hackborn
2009-09-28 01:08:26 -07:00
committed by Android Git Automerger

View File

@@ -214,11 +214,16 @@ 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;
mKeyguardHost.postDelayed(new Runnable() {
public void run() {
mKeyguardHost.removeView(mKeyguardView);
mKeyguardView.cleanUp();
mKeyguardView = null;
synchronized (KeyguardViewManager.this) {
if (mKeyguardView == lastView) {
mKeyguardHost.removeView(mKeyguardView);
mKeyguardView.cleanUp();
mKeyguardView = null;
}
}
}
}, 500);
}