diff --git a/quickstep/src/com/android/quickstep/ActivityControlHelper.java b/quickstep/src/com/android/quickstep/ActivityControlHelper.java index 8a6abb2d52..529a76550e 100644 --- a/quickstep/src/com/android/quickstep/ActivityControlHelper.java +++ b/quickstep/src/com/android/quickstep/ActivityControlHelper.java @@ -59,8 +59,6 @@ public interface ActivityControlHelper { LayoutListener createLayoutListener(T activity); - void onQuickstepGestureStarted(T activity, boolean activityVisible); - /** * Updates the UI to indicate quick interaction. * @return true if there any any UI change as a result of this @@ -116,11 +114,6 @@ public interface ActivityControlHelper { return new LauncherLayoutListener(activity); } - @Override - public void onQuickstepGestureStarted(Launcher activity, boolean activityVisible) { - activity.onQuickstepGestureStarted(activityVisible); - } - @Override public boolean onQuickInteractionStart(Launcher activity, boolean activityVisible) { LauncherState fromState = activity.getStateManager().getState(); @@ -137,10 +130,7 @@ public interface ActivityControlHelper { @Override public void executeOnWindowAvailable(Launcher activity, Runnable action) { - if (activity.getWorkspace().runOnOverlayHidden(action)) { - // Notify the activity that qiuckscrub has started - onQuickstepGestureStarted(activity, true); - } + activity.getWorkspace().runOnOverlayHidden(action); } @Override @@ -309,11 +299,6 @@ public interface ActivityControlHelper { class FallbackActivityControllerHelper implements ActivityControlHelper { - @Override - public void onQuickstepGestureStarted(RecentsActivity activity, boolean activityVisible) { - // TODO: - } - @Override public boolean onQuickInteractionStart(RecentsActivity activity, boolean activityVisible) { // Activity does not need any UI change for quickscrub. diff --git a/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java b/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java index 6ce9372be2..2d41a5bf6c 100644 --- a/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java +++ b/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java @@ -22,6 +22,8 @@ import static android.view.MotionEvent.ACTION_POINTER_UP; import static android.view.MotionEvent.ACTION_UP; import static android.view.MotionEvent.INVALID_POINTER_ID; +import static com.android.systemui.shared.system.ActivityManagerWrapper + .CLOSE_SYSTEM_WINDOWS_REASON_RECENTS; import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING; import android.annotation.TargetApi; @@ -73,6 +75,7 @@ public class OtherActivityTouchConsumer extends ContextWrapper implements TouchC private final ActivityControlHelper mActivityControlHelper; private final MainThreadExecutor mMainThreadExecutor; private final Choreographer mBackgroundThreadChoreographer; + private final OverviewCallbacks mOverviewCallbacks; private final boolean mIsDeferredDownTarget; private final PointF mDownPos = new PointF(); @@ -92,8 +95,10 @@ public class OtherActivityTouchConsumer extends ContextWrapper implements TouchC public OtherActivityTouchConsumer(Context base, RunningTaskInfo runningTaskInfo, RecentsModel recentsModel, Intent homeIntent, ActivityControlHelper activityControl, MainThreadExecutor mainThreadExecutor, Choreographer backgroundThreadChoreographer, - @HitTarget int downHitTarget, VelocityTracker velocityTracker) { + @HitTarget int downHitTarget, OverviewCallbacks overviewCallbacks, + VelocityTracker velocityTracker) { super(base); + mRunningTask = runningTaskInfo; mRecentsModel = recentsModel; mHomeIntent = homeIntent; @@ -102,6 +107,7 @@ public class OtherActivityTouchConsumer extends ContextWrapper implements TouchC mMainThreadExecutor = mainThreadExecutor; mBackgroundThreadChoreographer = backgroundThreadChoreographer; mIsDeferredDownTarget = activityControl.deferStartingActivity(downHitTarget); + mOverviewCallbacks = overviewCallbacks; } @Override @@ -187,6 +193,11 @@ public class OtherActivityTouchConsumer extends ContextWrapper implements TouchC if (mInteractionHandler == null) { return; } + + mOverviewCallbacks.closeAllWindows(); + ActivityManagerWrapper.getInstance().closeSystemWindows( + CLOSE_SYSTEM_WINDOWS_REASON_RECENTS); + // Notify the handler that the gesture has actually started mInteractionHandler.onGestureStarted(); } diff --git a/quickstep/src/com/android/quickstep/OverviewCallbacks.java b/quickstep/src/com/android/quickstep/OverviewCallbacks.java index 62938a7720..ac4a40b983 100644 --- a/quickstep/src/com/android/quickstep/OverviewCallbacks.java +++ b/quickstep/src/com/android/quickstep/OverviewCallbacks.java @@ -40,4 +40,6 @@ public class OverviewCallbacks { public void onInitOverviewTransition() { } public void onResetOverview() { } + + public void closeAllWindows() { } } diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index c9afcb571d..3babd1ffd6 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -164,6 +164,7 @@ public class TouchInteractionService extends Service { private ISystemUiProxy mISystemUiProxy; private OverviewCommandHelper mOverviewCommandHelper; private OverviewInteractionState mOverviewInteractionState; + private OverviewCallbacks mOverviewCallbacks; private Choreographer mMainThreadChoreographer; private Choreographer mBackgroundThreadChoreographer; @@ -179,6 +180,7 @@ public class TouchInteractionService extends Service { mMainThreadChoreographer = Choreographer.getInstance(); mEventQueue = new MotionEventQueue(mMainThreadChoreographer, mNoOpTouchConsumer); mOverviewInteractionState = OverviewInteractionState.getInstance(this); + mOverviewCallbacks = OverviewCallbacks.get(this); sConnected = true; @@ -230,7 +232,8 @@ public class TouchInteractionService extends Service { return new OtherActivityTouchConsumer(this, runningTaskInfo, mRecentsModel, mOverviewCommandHelper.overviewIntent, mOverviewCommandHelper.getActivityControlHelper(), mMainThreadExecutor, - mBackgroundThreadChoreographer, downHitTarget, tracker); + mBackgroundThreadChoreographer, downHitTarget, mOverviewCallbacks, + tracker); } } @@ -330,7 +333,7 @@ public class TouchInteractionService extends Service { if (mInvalidated) { return; } - mActivityHelper.onQuickstepGestureStarted(mActivity, true); + OverviewCallbacks.get(mActivity).closeAllWindows(); ActivityManagerWrapper.getInstance() .closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS); } @@ -341,10 +344,11 @@ public class TouchInteractionService extends Service { return; } if (interactionType == INTERACTION_QUICK_SCRUB) { + OverviewCallbacks.get(mActivity).closeAllWindows(); ActivityManagerWrapper.getInstance() .closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS); - mStartPending = true; + mStartPending = true; Runnable action = () -> { mQuickScrubController.onQuickScrubStart(mActivityHelper.onQuickInteractionStart( mActivity, true), mActivityHelper); diff --git a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java index 027f2e9df9..4e17b4b4c3 100644 --- a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java +++ b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java @@ -24,7 +24,6 @@ import static com.android.launcher3.anim.Interpolators.TOUCH_RESPONSE_INTERPOLAT import static com.android.quickstep.QuickScrubController.QUICK_SCRUB_START_DURATION; import static com.android.quickstep.TouchConsumer.INTERACTION_NORMAL; import static com.android.quickstep.TouchConsumer.INTERACTION_QUICK_SCRUB; -import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS; import android.animation.Animator; import android.animation.ObjectAnimator; @@ -69,7 +68,6 @@ import com.android.quickstep.util.SysuiEventLogger; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; import com.android.systemui.shared.recents.model.ThumbnailData; -import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.InputConsumerController; import com.android.systemui.shared.system.LatencyTrackerCompat; import com.android.systemui.shared.system.RecentsAnimationControllerCompat; @@ -564,8 +562,6 @@ public class WindowTransformSwipeHandler { mGestureStarted = true; mRecentsAnimationWrapper.hideCurrentInputMethod(); mRecentsAnimationWrapper.enableInputConsumer(); - ActivityManagerWrapper.getInstance().closeSystemWindows( - CLOSE_SYSTEM_WINDOWS_REASON_RECENTS); } /** @@ -579,8 +575,6 @@ public class WindowTransformSwipeHandler { // Once the gesture starts, we can no longer transition home through the button, so // reset the force override of the activity visibility mActivity.clearForceInvisibleFlag(INVISIBLE_BY_STATE_HANDLER); - mActivityControlHelper.onQuickstepGestureStarted( - curActivity, mWasLauncherAlreadyVisible); } } diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index db817e737c..9a9e001c3e 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1155,12 +1155,6 @@ public class Launcher extends BaseDraggingActivity } } - public void onQuickstepGestureStarted(boolean isVisible) { - if (mLauncherCallbacks != null) { - mLauncherCallbacks.onQuickstepGestureStarted(isVisible); - } - } - public AllAppsTransitionController getAllAppsController() { return mAllAppsController; } diff --git a/src/com/android/launcher3/LauncherCallbacks.java b/src/com/android/launcher3/LauncherCallbacks.java index 6aef658b40..34bdb3c24a 100644 --- a/src/com/android/launcher3/LauncherCallbacks.java +++ b/src/com/android/launcher3/LauncherCallbacks.java @@ -18,7 +18,6 @@ package com.android.launcher3; import android.content.Intent; import android.os.Bundle; -import android.view.Menu; import java.io.FileDescriptor; import java.io.PrintWriter; @@ -70,12 +69,4 @@ public interface LauncherCallbacks { * Extensions points for adding / replacing some other aspects of the Launcher experience. */ boolean hasSettings(); - - /** - * Called when launcher integrated quickstep and some quickstep gesture started. It can be - * called multiple times for a single gesture an UI or background thread. - * - * @param isVisible if Launcher was visible when the gesture started. - */ - void onQuickstepGestureStarted(boolean isVisible); }