commit | f190a858c81c1c76011fbabb9bc6c37517b27ef1 | [log] [tgz] |
---|---|---|
author | Lucas Dupin <dupin@google.com> | Mon Jul 31 17:11:26 2017 -0700 |
committer | Lucas Dupin <dupin@google.com> | Mon Jul 31 17:34:54 2017 -0700 |
tree | fe4c4091e4cb773cd49df9a0cc3eef2b8711827b | |
parent | cbab3edc3eb7ff33126e31c45fd059b45ebb41ca [diff] |
Fix race condition when destroying view Calling ensureView before triggering mRemoveViewRunnable would halt view re-inflation. Now we make sure that the view will be removed. Test: Increased handler delay to simulate race condition. Change-Id: Ic987f307c268b973058a80ab546da87f43fefb1b Fixes: 63890571
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java index 49bac99..fd95cc4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
@@ -234,8 +234,11 @@ } protected void ensureView() { - mHandler.removeCallbacks(mRemoveViewRunnable); - if (mRoot == null) { + // Removal of the view might be deferred to reduce unlock latency, + // in this case we need to force the removal, otherwise we'll + // end up in an unpredictable state. + boolean forceRemoval = mHandler.hasCallbacks(mRemoveViewRunnable); + if (mRoot == null || forceRemoval) { inflateView(); } }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index 252df17..e142d62 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -404,6 +404,7 @@ public void onOverlayChanged() { mBouncer.hide(true /* destroyView */); + mBouncer.prepare(); } private void animateScrimControllerKeyguardFadingOut(long delay, long duration,