Loading quickstep/src/com/android/quickstep/RecentsAnimationController.java +18 −7 Original line number Diff line number Diff line Loading @@ -150,10 +150,17 @@ public class RecentsAnimationController { @UiThread public void finishController(boolean toRecents, Runnable callback, boolean sendUserLeaveHint) { if (mFinishRequested) { // If finishing, add to pending finish callbacks, otherwise, if finished, adding to the // destroyed RunnableList will just trigger the callback to be called immediately finishController(toRecents, callback, sendUserLeaveHint, false /* forceFinish */); } @UiThread public void finishController(boolean toRecents, Runnable callback, boolean sendUserLeaveHint, boolean forceFinish) { mPendingFinishCallbacks.add(callback); if (!forceFinish && mFinishRequested) { // If finish has already been requested, then add the callback to the pending list. // If already finished, then adding it to the destroyed RunnableList will just // trigger the callback to be called immediately return; } ActiveGestureLog.INSTANCE.addLog( Loading @@ -165,15 +172,19 @@ public class RecentsAnimationController { mFinishRequested = true; mFinishTargetIsLauncher = toRecents; mOnFinishedListener.accept(this); mPendingFinishCallbacks.add(callback); UI_HELPER_EXECUTOR.execute(() -> { Runnable finishCb = () -> { mController.finish(toRecents, sendUserLeaveHint); InteractionJankMonitorWrapper.end(InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH); InteractionJankMonitorWrapper.end(InteractionJankMonitorWrapper.CUJ_APP_CLOSE_TO_HOME); InteractionJankMonitorWrapper.end( InteractionJankMonitorWrapper.CUJ_APP_SWIPE_TO_RECENTS); MAIN_EXECUTOR.execute(mPendingFinishCallbacks::executeAllAndDestroy); }); }; if (forceFinish) { finishCb.run(); } else { UI_HELPER_EXECUTOR.execute(finishCb); } } /** Loading quickstep/src/com/android/quickstep/TaskAnimationManager.java +17 −4 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn } } // But force-finish it anyways finishRunningRecentsAnimation(false /* toHome */); finishRunningRecentsAnimation(false /* toHome */, true /* forceFinish */); if (mCallbacks != null) { // If mCallbacks still != null, that means we are getting this startRecentsAnimation() Loading Loading @@ -291,13 +291,26 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn * Finishes the running recents animation. */ public void finishRunningRecentsAnimation(boolean toHome) { finishRunningRecentsAnimation(toHome, false /* forceFinish */); } /** * Finishes the running recents animation. * @param forceFinish will synchronously finish the controller */ private void finishRunningRecentsAnimation(boolean toHome, boolean forceFinish) { if (mController != null) { ActiveGestureLog.INSTANCE.addLog( /* event= */ "finishRunningRecentsAnimation", toHome); mCallbacks.notifyAnimationCanceled(); if (forceFinish) { mController.finishController(toHome, null, false /* sendUserLeaveHint */, true /* forceFinish */); } else { Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), toHome ? mController::finishAnimationToHome : mController::finishAnimationToApp); } cleanUpRecentsAnimation(); } } Loading Loading
quickstep/src/com/android/quickstep/RecentsAnimationController.java +18 −7 Original line number Diff line number Diff line Loading @@ -150,10 +150,17 @@ public class RecentsAnimationController { @UiThread public void finishController(boolean toRecents, Runnable callback, boolean sendUserLeaveHint) { if (mFinishRequested) { // If finishing, add to pending finish callbacks, otherwise, if finished, adding to the // destroyed RunnableList will just trigger the callback to be called immediately finishController(toRecents, callback, sendUserLeaveHint, false /* forceFinish */); } @UiThread public void finishController(boolean toRecents, Runnable callback, boolean sendUserLeaveHint, boolean forceFinish) { mPendingFinishCallbacks.add(callback); if (!forceFinish && mFinishRequested) { // If finish has already been requested, then add the callback to the pending list. // If already finished, then adding it to the destroyed RunnableList will just // trigger the callback to be called immediately return; } ActiveGestureLog.INSTANCE.addLog( Loading @@ -165,15 +172,19 @@ public class RecentsAnimationController { mFinishRequested = true; mFinishTargetIsLauncher = toRecents; mOnFinishedListener.accept(this); mPendingFinishCallbacks.add(callback); UI_HELPER_EXECUTOR.execute(() -> { Runnable finishCb = () -> { mController.finish(toRecents, sendUserLeaveHint); InteractionJankMonitorWrapper.end(InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH); InteractionJankMonitorWrapper.end(InteractionJankMonitorWrapper.CUJ_APP_CLOSE_TO_HOME); InteractionJankMonitorWrapper.end( InteractionJankMonitorWrapper.CUJ_APP_SWIPE_TO_RECENTS); MAIN_EXECUTOR.execute(mPendingFinishCallbacks::executeAllAndDestroy); }); }; if (forceFinish) { finishCb.run(); } else { UI_HELPER_EXECUTOR.execute(finishCb); } } /** Loading
quickstep/src/com/android/quickstep/TaskAnimationManager.java +17 −4 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn } } // But force-finish it anyways finishRunningRecentsAnimation(false /* toHome */); finishRunningRecentsAnimation(false /* toHome */, true /* forceFinish */); if (mCallbacks != null) { // If mCallbacks still != null, that means we are getting this startRecentsAnimation() Loading Loading @@ -291,13 +291,26 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn * Finishes the running recents animation. */ public void finishRunningRecentsAnimation(boolean toHome) { finishRunningRecentsAnimation(toHome, false /* forceFinish */); } /** * Finishes the running recents animation. * @param forceFinish will synchronously finish the controller */ private void finishRunningRecentsAnimation(boolean toHome, boolean forceFinish) { if (mController != null) { ActiveGestureLog.INSTANCE.addLog( /* event= */ "finishRunningRecentsAnimation", toHome); mCallbacks.notifyAnimationCanceled(); if (forceFinish) { mController.finishController(toHome, null, false /* sendUserLeaveHint */, true /* forceFinish */); } else { Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), toHome ? mController::finishAnimationToHome : mController::finishAnimationToApp); } cleanUpRecentsAnimation(); } } Loading