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

Commit 5040a837 authored by Schneider Victor-tulias's avatar Schneider Victor-tulias
Browse files

Fix blocked gesture handling on failed startRecentsActivity calls

Flag: N/A
Fixes: 324228222
Test: forcicly set SystemUiProxy.mRecentTasks to null. multiple startRecentsActivity call attempts were made rather than just one
Change-Id: I2e5f8cc0cf47a143dcd7985b31292bb4d8cbbcad
parent 3d7e1c29
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -115,7 +115,6 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
        ActiveGestureLog.INSTANCE.addLog(
                /* event= */ "startRecentsAnimation",
                /* gestureEvent= */ START_RECENTS_ANIMATION);
        mRecentsAnimationStartPending = true;
        // Notify if recents animation is still running
        if (mController != null) {
            String msg = "New recents animation started before old animation completed";
@@ -300,10 +299,16 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
                options.setTransientLaunch();
            }
            options.setSourceInfo(ActivityOptions.SourceInfo.TYPE_RECENTS_ANIMATION, eventTime);
            SystemUiProxy.INSTANCE.getNoCreate().startRecentsActivity(intent, options, mCallbacks);
            mRecentsAnimationStartPending = SystemUiProxy.INSTANCE.getNoCreate()
                    .startRecentsActivity(intent, options, mCallbacks);
        } else {
            UI_HELPER_EXECUTOR.execute(() -> ActivityManagerWrapper.getInstance()
                    .startRecentsActivity(intent, eventTime, mCallbacks, null, null));
            UI_HELPER_EXECUTOR.execute(
                    () -> ActivityManagerWrapper.getInstance().startRecentsActivity(
                            intent,
                            eventTime,
                            mCallbacks,
                            result -> mRecentsAnimationStartPending = result,
                            MAIN_EXECUTOR.getHandler()));
        }
        gestureState.setState(STATE_RECENTS_ANIMATION_INITIALIZED);
        return mCallbacks;