Loading quickstep/src/com/android/quickstep/TaskAnimationManager.java +12 −8 Original line number Diff line number Diff line Loading @@ -125,13 +125,14 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn // If mCallbacks still != null, that means we are getting this startRecentsAnimation() // before the previous one got onRecentsAnimationStart(). In that case, cleanup the // previous animation so it doesn't mess up/listen to state changes in this animation. cleanUpRecentsAnimation(); cleanUpRecentsAnimation(mCallbacks); } final BaseActivityInterface activityInterface = gestureState.getActivityInterface(); mLastGestureState = gestureState; mCallbacks = new RecentsAnimationCallbacks(SystemUiProxy.INSTANCE.get(mCtx), activityInterface.allowMinimizeSplitScreen()); RecentsAnimationCallbacks newCallbacks = new RecentsAnimationCallbacks( SystemUiProxy.INSTANCE.get(mCtx), activityInterface.allowMinimizeSplitScreen()); mCallbacks = newCallbacks; mCallbacks.addListener(new RecentsAnimationCallbacks.RecentsAnimationListener() { @Override public void onRecentsAnimationStart(RecentsAnimationController controller, Loading @@ -157,12 +158,12 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn @Override public void onRecentsAnimationCanceled(HashMap<Integer, ThumbnailData> thumbnailDatas) { cleanUpRecentsAnimation(); cleanUpRecentsAnimation(newCallbacks); } @Override public void onRecentsAnimationFinished(RecentsAnimationController controller) { cleanUpRecentsAnimation(); cleanUpRecentsAnimation(newCallbacks); } @Override Loading Loading @@ -334,7 +335,6 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn if (mController != null) { ActiveGestureLog.INSTANCE.addLog( /* event= */ "finishRunningRecentsAnimation", toHome); mCallbacks.notifyAnimationCanceled(); if (forceFinish) { mController.finishController(toHome, null, false /* sendUserLeaveHint */, true /* forceFinish */); Loading @@ -343,7 +343,6 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn ? mController::finishAnimationToHome : mController::finishAnimationToApp); } cleanUpRecentsAnimation(); } } Loading @@ -370,7 +369,12 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn /** * Cleans up the recents animation entirely. */ private void cleanUpRecentsAnimation() { private void cleanUpRecentsAnimation(RecentsAnimationCallbacks targetCallbacks) { if (mCallbacks != targetCallbacks) { ActiveGestureLog.INSTANCE.addLog( /* event= */ "cleanUpRecentsAnimation skipped due to wrong callbacks"); return; } ActiveGestureLog.INSTANCE.addLog(/* event= */ "cleanUpRecentsAnimation"); if (mLiveTileCleanUpHandler != null) { mLiveTileCleanUpHandler.run(); Loading Loading
quickstep/src/com/android/quickstep/TaskAnimationManager.java +12 −8 Original line number Diff line number Diff line Loading @@ -125,13 +125,14 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn // If mCallbacks still != null, that means we are getting this startRecentsAnimation() // before the previous one got onRecentsAnimationStart(). In that case, cleanup the // previous animation so it doesn't mess up/listen to state changes in this animation. cleanUpRecentsAnimation(); cleanUpRecentsAnimation(mCallbacks); } final BaseActivityInterface activityInterface = gestureState.getActivityInterface(); mLastGestureState = gestureState; mCallbacks = new RecentsAnimationCallbacks(SystemUiProxy.INSTANCE.get(mCtx), activityInterface.allowMinimizeSplitScreen()); RecentsAnimationCallbacks newCallbacks = new RecentsAnimationCallbacks( SystemUiProxy.INSTANCE.get(mCtx), activityInterface.allowMinimizeSplitScreen()); mCallbacks = newCallbacks; mCallbacks.addListener(new RecentsAnimationCallbacks.RecentsAnimationListener() { @Override public void onRecentsAnimationStart(RecentsAnimationController controller, Loading @@ -157,12 +158,12 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn @Override public void onRecentsAnimationCanceled(HashMap<Integer, ThumbnailData> thumbnailDatas) { cleanUpRecentsAnimation(); cleanUpRecentsAnimation(newCallbacks); } @Override public void onRecentsAnimationFinished(RecentsAnimationController controller) { cleanUpRecentsAnimation(); cleanUpRecentsAnimation(newCallbacks); } @Override Loading Loading @@ -334,7 +335,6 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn if (mController != null) { ActiveGestureLog.INSTANCE.addLog( /* event= */ "finishRunningRecentsAnimation", toHome); mCallbacks.notifyAnimationCanceled(); if (forceFinish) { mController.finishController(toHome, null, false /* sendUserLeaveHint */, true /* forceFinish */); Loading @@ -343,7 +343,6 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn ? mController::finishAnimationToHome : mController::finishAnimationToApp); } cleanUpRecentsAnimation(); } } Loading @@ -370,7 +369,12 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn /** * Cleans up the recents animation entirely. */ private void cleanUpRecentsAnimation() { private void cleanUpRecentsAnimation(RecentsAnimationCallbacks targetCallbacks) { if (mCallbacks != targetCallbacks) { ActiveGestureLog.INSTANCE.addLog( /* event= */ "cleanUpRecentsAnimation skipped due to wrong callbacks"); return; } ActiveGestureLog.INSTANCE.addLog(/* event= */ "cleanUpRecentsAnimation"); if (mLiveTileCleanUpHandler != null) { mLiveTileCleanUpHandler.run(); Loading