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

Commit 1b636fa6 authored by Arthur Hung's avatar Arthur Hung
Browse files

Fix InputConsumer for RecentsAnimationController may access null pointer

Once recents died, it would post a cancel animation
and remove its InputConsumer. So it would be a race condition
when updateInputWindows and remove the InputConsumer.
We need to add a protect for this.

Bug: 120439400
Test: go/wm-smoke
Test: swiping up on the Home button
Change-Id: I5c4323d90ee5a54a2fe655d803be7a3f1561fe2d
parent d830ca25
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -504,11 +504,13 @@ public class RecentsAnimationController implements DeathRecipient {
    public void binderDied() {
        cancelAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION, "binderDied");

        synchronized (mService.getWindowManagerLock()) {
            // Clear associated input consumers on runner death
            final InputMonitor inputMonitor =
                    mService.mRoot.getDisplayContent(mDisplayId).getInputMonitor();
            inputMonitor.destroyInputConsumer(INPUT_CONSUMER_RECENTS_ANIMATION);
        }
    }

    void checkAnimationReady(WallpaperController wallpaperController) {
        if (mPendingStart) {