diff options
3 files changed, 27 insertions, 3 deletions
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 16f141b17b..61d36fb1f7 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -147,6 +147,8 @@ public class TouchInteractionService extends Service */ public class TISBinder extends IOverviewProxy.Stub { + @Nullable private Runnable mOnOverviewTargetChangeListener = null; + @BinderThread public void onInitialize(Bundle bundle) { ISystemUiProxy proxy = ISystemUiProxy.Stub.asInterface( @@ -327,6 +329,18 @@ public class TouchInteractionService extends Service public void setGestureBlockedTaskId(int taskId) { mDeviceState.setGestureBlockingTaskId(taskId); } + + /** Sets a listener to be run on Overview Target updates. */ + public void setOverviewTargetChangeListener(@Nullable Runnable listener) { + mOnOverviewTargetChangeListener = listener; + } + + protected void onOverviewTargetChange() { + if (mOnOverviewTargetChangeListener != null) { + mOnOverviewTargetChangeListener.run(); + mOnOverviewTargetChangeListener = null; + } + } } private static boolean sConnected = false; @@ -487,6 +501,7 @@ public class TouchInteractionService extends Service if (newOverviewActivity != null) { mTaskbarManager.setActivity(newOverviewActivity); } + mTISBinder.onOverviewTargetChange(); } @UiThread diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java index 11f0ff3259..e458c1f022 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java @@ -425,12 +425,18 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC mMainThreadHandler.removeCallbacks(mCancelRecentsAnimationRunnable); mMainThreadHandler.postDelayed(mCancelRecentsAnimationRunnable, 100); } - mVelocityTracker.recycle(); - mVelocityTracker = null; - mMotionPauseDetector.clear(); + cleanupAfterGesture(); TraceHelper.INSTANCE.endSection(traceToken); } + private void cleanupAfterGesture() { + if (mVelocityTracker != null) { + mVelocityTracker.recycle(); + mVelocityTracker = null; + } + mMotionPauseDetector.clear(); + } + @Override public void notifyOrientationSetup() { mRotationTouchHelper.onStartGesture(); @@ -453,6 +459,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC Preconditions.assertUIThread(); removeListener(); mInteractionHandler = null; + cleanupAfterGesture(); mOnCompleteCallback.accept(this); } diff --git a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java index caf61c790e..5680170a8f 100644 --- a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java +++ b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java @@ -202,6 +202,7 @@ public class AllSetActivity extends Activity { mBinder = binder; mBinder.getTaskbarManager().setSetupUIVisible(isResumed()); mBinder.setSwipeUpProxy(isResumed() ? this::createSwipeUpProxy : null); + mBinder.setOverviewTargetChangeListener(mBinder::preloadOverviewForSUWAllSet); mBinder.preloadOverviewForSUWAllSet(); } @@ -218,6 +219,7 @@ public class AllSetActivity extends Activity { if (mBinder != null) { mBinder.getTaskbarManager().setSetupUIVisible(false); mBinder.setSwipeUpProxy(null); + mBinder.setOverviewTargetChangeListener(null); } } |