Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f190a858 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

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
parent cbab3edc
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -234,8 +234,11 @@ public class KeyguardBouncer {
    }

    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();
        }
    }
+1 −0
Original line number Diff line number Diff line
@@ -404,6 +404,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb

    public void onOverlayChanged() {
        mBouncer.hide(true /* destroyView */);
        mBouncer.prepare();
    }

    private void animateScrimControllerKeyguardFadingOut(long delay, long duration,