diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java index 2e4e7397aa..8fb70300f6 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java @@ -88,6 +88,11 @@ public abstract class BaseRecentsViewStateController return; } setStateWithAnimationInternal(toState, config, builder); + builder.addEndListener(success -> { + if (!success) { + mRecentsView.reset(); + } + }); } /** diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java index 1e0ceed4cd..19a6c38901 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java @@ -78,6 +78,11 @@ public class FallbackRecentsStateController implements StateHandler mRecentsView.loadVisibleTaskData(FLAG_UPDATE_ALL)); + setter.addEndListener(success -> { + if (!success) { + mRecentsView.reset(); + } + }); mRecentsView.updateEmptyMessage(); setProperties(toState, config, setter); diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java index 93eb0f1245..e32aaee532 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java @@ -231,11 +231,6 @@ public class FallbackRecentsView extends RecentsView> { onStateTransitionEnd(state); } - @Override - public void onAnimationCancel(Animator animation) { - super.onAnimationCancel(animation); - onStateTransitionFailed(state); - } }; } @@ -360,12 +355,6 @@ public class StateManager> { } } - private void onStateTransitionFailed(STATE_TYPE state) { - for (int i = mListeners.size() - 1; i >= 0; i--) { - mListeners.get(i).onStateTransitionFailed(state); - } - } - private void onStateTransitionEnd(STATE_TYPE state) { // Only change the stable states after the transitions have finished if (state != mCurrentStableState) { @@ -600,11 +589,6 @@ public class StateManager> { default void onStateTransitionStart(STATE_TYPE toState) { } - /** - * If the state transition animation fails (e.g. is canceled by the user), this fires. - */ - default void onStateTransitionFailed(STATE_TYPE toState) { } - default void onStateTransitionComplete(STATE_TYPE finalState) { } }