Merge "Do some additional cleanup when switching handlers" into sc-dev
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index 0ebaea2..4d47ef1 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -1381,11 +1381,17 @@
/**
* Cancels any running animation so that the active target can be overriden by a new swipe
- * handle (in case of quick switch).
+ * handler (in case of quick switch).
*/
private void cancelCurrentAnimation() {
mCanceled = true;
mCurrentShift.cancelAnimation();
+
+ // Cleanup when switching handlers
+ mInputConsumerProxy.unregisterCallback();
+ mActivityInitListener.unregister();
+ ActivityManagerWrapper.getInstance().unregisterTaskStackListener(mActivityRestartListener);
+ mTaskSnapshot = null;
}
private void invalidateHandler() {