Fix potential race when removing keyguard view.

Change-Id: Ia636bc8a73d18b8ebe2dca2b29bb74793a3f0396
This commit is contained in:
Dianne Hackborn
2009-09-25 17:35:10 -07:00
parent cd3d3f22ab
commit d7f7deb286

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);
}