diff --git a/go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java b/go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java index b1a388133c..f31cf37d0f 100644 --- a/go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java +++ b/go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java @@ -32,7 +32,6 @@ import android.util.Log; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.LauncherAnimationRunner; import com.android.quickstep.util.RemoteAnimationProvider; -import com.android.quickstep.util.RemoteAnimationTargets; import com.android.quickstep.views.IconRecentsView; import com.android.systemui.shared.system.ActivityOptionsCompat; import com.android.systemui.shared.system.RemoteAnimationAdapterCompat; @@ -113,9 +112,9 @@ final class AppToOverviewAnimationProvider imple return anim; } - RemoteAnimationTargets targetSet = + RemoteAnimationTargets targets = new RemoteAnimationTargets(appTargets, wallpaperTargets, MODE_CLOSING); - mRecentsView.setTransitionedFromApp(!targetSet.isAnimatingHome()); + mRecentsView.setTransitionedFromApp(!targets.isAnimatingHome()); RemoteAnimationTargetCompat recentsTarget = null; RemoteAnimationTargetCompat closingAppTarget = null; diff --git a/go/quickstep/src/com/android/quickstep/FallbackActivityControllerHelper.java b/go/quickstep/src/com/android/quickstep/FallbackActivityControllerHelper.java index 37c2c04306..ee860ab2cd 100644 --- a/go/quickstep/src/com/android/quickstep/FallbackActivityControllerHelper.java +++ b/go/quickstep/src/com/android/quickstep/FallbackActivityControllerHelper.java @@ -27,7 +27,6 @@ import androidx.annotation.Nullable; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.userevent.nano.LauncherLogProto; import com.android.quickstep.util.ActivityInitListener; -import com.android.quickstep.util.RemoteAnimationTargets; import com.android.quickstep.views.IconRecentsView; import java.util.function.BiPredicate; diff --git a/go/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/go/quickstep/src/com/android/quickstep/OverviewCommandHelper.java index 9c409ccca5..f65109afde 100644 --- a/go/quickstep/src/com/android/quickstep/OverviewCommandHelper.java +++ b/go/quickstep/src/com/android/quickstep/OverviewCommandHelper.java @@ -40,26 +40,28 @@ import com.android.systemui.shared.system.LatencyTrackerCompat; public class OverviewCommandHelper { private final Context mContext; - private final ActivityManagerWrapper mAM; + private final RecentsAnimationDeviceState mDeviceState; private final RecentsModel mRecentsModel; private final OverviewComponentObserver mOverviewComponentObserver; private long mLastToggleTime; - public OverviewCommandHelper(Context context, OverviewComponentObserver observer) { + public OverviewCommandHelper(Context context, RecentsAnimationDeviceState deviceState, + OverviewComponentObserver observer) { mContext = context; - mAM = ActivityManagerWrapper.getInstance(); + mDeviceState = deviceState; mRecentsModel = RecentsModel.INSTANCE.get(mContext); mOverviewComponentObserver = observer; } public void onOverviewToggle() { // If currently screen pinning, do not enter overview - if (mAM.isScreenPinningActive()) { + if (mDeviceState.isScreenPinningActive()) { return; } - mAM.closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS); + ActivityManagerWrapper.getInstance() + .closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS); MAIN_EXECUTOR.execute(new RecentsActivityCommand<>()); } diff --git a/go/quickstep/src/com/android/quickstep/TouchInteractionService.java b/go/quickstep/src/com/android/quickstep/TouchInteractionService.java index 0012ad4e98..f743663326 100644 --- a/go/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/go/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -148,7 +148,7 @@ public class TouchInteractionService extends Service { public void onUserUnlocked() { mRecentsModel = RecentsModel.INSTANCE.get(this); mOverviewComponentObserver = new OverviewComponentObserver(this, mDeviceState); - mOverviewCommandHelper = new OverviewCommandHelper(this, + mOverviewCommandHelper = new OverviewCommandHelper(this, mDeviceState, mOverviewComponentObserver); } diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java index 1b49732cb2..3eab5ac873 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java @@ -32,7 +32,6 @@ import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.anim.AnimationSuccessListener; import com.android.quickstep.util.AppWindowAnimationHelper; import com.android.quickstep.util.RemoteAnimationProvider; -import com.android.quickstep.util.RemoteAnimationTargets; import com.android.quickstep.views.RecentsView; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat; @@ -115,11 +114,11 @@ final class AppToOverviewAnimationProvider imple return anim; } - RemoteAnimationTargets targetSet = new RemoteAnimationTargets(appTargets, + RemoteAnimationTargets targets = new RemoteAnimationTargets(appTargets, wallpaperTargets, MODE_CLOSING); // Use the top closing app to determine the insets for the animation - RemoteAnimationTargetCompat runningTaskTarget = targetSet.findTask(mTargetTaskId); + RemoteAnimationTargetCompat runningTaskTarget = targets.findTask(mTargetTaskId); if (runningTaskTarget == null) { Log.e(TAG, "No closing app"); anim.play(ValueAnimator.ofInt(0, 1).setDuration(RECENTS_LAUNCH_DURATION)); @@ -149,12 +148,12 @@ final class AppToOverviewAnimationProvider imple valueAnimator.setInterpolator(TOUCH_RESPONSE_INTERPOLATOR); valueAnimator.addUpdateListener((v) -> { params.setProgress((float) v.getAnimatedValue()) - .setTargetSet(targetSet) + .setTargetSet(targets) .setLauncherOnTop(true); clipHelper.applyTransform(params); }); - if (targetSet.isAnimatingHome()) { + if (targets.isAnimatingHome()) { // If we are animating home, fade in the opening targets RemoteAnimationTargets openingSet = new RemoteAnimationTargets(appTargets, wallpaperTargets, MODE_OPENING); diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java index d391c46e13..9eb2d4c919 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java @@ -58,14 +58,12 @@ import com.android.launcher3.graphics.RotationMode; import com.android.launcher3.views.FloatingIconView; import com.android.quickstep.ActivityControlHelper.HomeAnimationFactory; import com.android.quickstep.SysUINavigationMode.Mode; -import com.android.quickstep.inputconsumers.InputConsumer; import com.android.quickstep.util.ActiveGestureLog; import com.android.quickstep.util.ActivityInitListener; import com.android.quickstep.util.AppWindowAnimationHelper; import com.android.quickstep.util.AppWindowAnimationHelper.TransformParams; import com.android.quickstep.util.RectFSpringAnim; -import com.android.quickstep.util.RecentsAnimationTargets; -import com.android.quickstep.util.RecentsAnimationCallbacks.RecentsAnimationListener; +import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; import com.android.systemui.shared.recents.model.ThumbnailData; @@ -118,7 +116,7 @@ public abstract class BaseSwipeUpHandler - mRecentsView.setRecentsAnimationTargets(mRecentsAnimationWrapper, + mRecentsView.setRecentsAnimationTargets(mRecentsAnimationController, mRecentsAnimationTargets)); } @@ -240,7 +238,7 @@ public abstract class BaseSwipeUpHandler { + mRecentsAnimationController.finish(true /* toRecents */, () -> { if (!mCanceled) { TaskView nextTask = mRecentsView.getTaskView(taskId); if (nextTask != null) { @@ -284,17 +282,17 @@ public abstract class BaseSwipeUpHandler()); } + @BinderThread public void onOverviewShown(boolean triggeredFromAltTab) { MAIN_EXECUTOR.execute(new ShowRecentsCommand(triggeredFromAltTab)); } + @BinderThread public void onOverviewHidden() { MAIN_EXECUTOR.execute(new HideRecentsCommand()); } + @BinderThread public void onTip(int actionType, int viewType) { MAIN_EXECUTOR.execute(() -> UserEventDispatcher.newInstance(mContext).logActionTip(actionType, viewType)); diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/SwipeSharedState.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/SwipeSharedState.java index e09c9cb8fa..7beab5bae1 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/SwipeSharedState.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/SwipeSharedState.java @@ -22,9 +22,7 @@ import android.util.Log; import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.util.Preconditions; -import com.android.quickstep.util.RecentsAnimationCallbacks; -import com.android.quickstep.util.RecentsAnimationTargets; -import com.android.quickstep.util.RecentsAnimationCallbacks.RecentsAnimationListener; +import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener; import com.android.systemui.shared.recents.model.ThumbnailData; @@ -38,7 +36,7 @@ public class SwipeSharedState implements RecentsAnimationListener { private OverviewComponentObserver mOverviewComponentObserver; private RecentsAnimationCallbacks mRecentsAnimationListener; - private RecentsAnimationWrapper mLastRecentsAnimationController; + private RecentsAnimationController mLastRecentsAnimationController; private RecentsAnimationTargets mLastAnimationTarget; private boolean mLastAnimationCancelled = false; @@ -55,10 +53,10 @@ public class SwipeSharedState implements RecentsAnimationListener { } @Override - public final void onRecentsAnimationStart(RecentsAnimationWrapper controller, - RecentsAnimationTargets targetSet) { + public final void onRecentsAnimationStart(RecentsAnimationController controller, + RecentsAnimationTargets targets) { mLastRecentsAnimationController = controller; - mLastAnimationTarget = targetSet; + mLastAnimationTarget = targets; mLastAnimationCancelled = false; mLastAnimationRunning = true; @@ -78,7 +76,7 @@ public class SwipeSharedState implements RecentsAnimationListener { } @Override - public final void onRecentsAnimationFinished(RecentsAnimationWrapper controller) { + public final void onRecentsAnimationFinished(RecentsAnimationController controller) { if (mLastRecentsAnimationController == controller) { mLastAnimationRunning = false; } @@ -117,7 +115,7 @@ public class SwipeSharedState implements RecentsAnimationListener { mLastAnimationRunning = false; } - public RecentsAnimationCallbacks newRecentsAnimationListenerSet() { + public RecentsAnimationCallbacks newRecentsAnimationCallbacks() { Preconditions.assertUIThread(); if (mLastAnimationRunning) { diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskViewUtils.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskViewUtils.java index b55fd8b54d..2522c0fb96 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskViewUtils.java @@ -33,7 +33,6 @@ import com.android.launcher3.ItemInfo; import com.android.launcher3.Utilities; import com.android.quickstep.util.AppWindowAnimationHelper; import com.android.quickstep.util.MultiValueUpdateListener; -import com.android.quickstep.util.RemoteAnimationTargets; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; import com.android.systemui.shared.recents.model.Task; @@ -121,13 +120,13 @@ public final class TaskViewUtils { RemoteAnimationTargetCompat[] wallpaperTargets, final AppWindowAnimationHelper inOutHelper) { SyncRtSurfaceTransactionApplierCompat applier = new SyncRtSurfaceTransactionApplierCompat(v); - final RemoteAnimationTargets targetSet = + final RemoteAnimationTargets targets = new RemoteAnimationTargets(appTargets, wallpaperTargets, MODE_OPENING); - targetSet.addDependentTransactionApplier(applier); + targets.addDependentTransactionApplier(applier); AppWindowAnimationHelper.TransformParams params = new AppWindowAnimationHelper.TransformParams() .setSyncTransactionApplier(applier) - .setTargetSet(targetSet) + .setTargetSet(targets) .setLauncherOnTop(true); final RecentsView recentsView = v.getRecentsView(); @@ -149,7 +148,7 @@ public final class TaskViewUtils { BaseActivity.fromContext(v.getContext()).getDeviceProfile(), true /* isOpening */); inOutHelper.fromTaskThumbnailView(v.getThumbnail(), (RecentsView) v.getParent(), - targetSet.apps.length == 0 ? null : targetSet.apps[0]); + targets.apps.length == 0 ? null : targets.apps[0]); mThumbnailRect = new RectF(inOutHelper.getTargetRect()); mThumbnailRect.offset(-v.getTranslationX(), -v.getTranslationY()); @@ -203,7 +202,7 @@ public final class TaskViewUtils { appAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { - targetSet.release(); + targets.release(); } }); return appAnimator; diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java index 41d94714a6..2616d0dff9 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java @@ -48,6 +48,7 @@ import android.view.Choreographer; import android.view.InputEvent; import android.view.MotionEvent; +import androidx.annotation.BinderThread; import androidx.annotation.UiThread; import androidx.annotation.WorkerThread; @@ -66,7 +67,6 @@ import com.android.quickstep.inputconsumers.AccessibilityInputConsumer; import com.android.quickstep.inputconsumers.AssistantInputConsumer; import com.android.quickstep.inputconsumers.DeviceLockedInputConsumer; import com.android.quickstep.inputconsumers.FallbackNoButtonInputConsumer; -import com.android.quickstep.inputconsumers.InputConsumer; import com.android.quickstep.inputconsumers.OtherActivityInputConsumer; import com.android.quickstep.inputconsumers.OverviewInputConsumer; import com.android.quickstep.inputconsumers.OverviewWithoutFocusInputConsumer; @@ -123,6 +123,7 @@ public class TouchInteractionService extends Service implements private final IBinder mMyBinder = new IOverviewProxy.Stub() { + @BinderThread public void onInitialize(Bundle bundle) { ISystemUiProxy proxy = ISystemUiProxy.Stub.asInterface( bundle.getBinder(KEY_EXTRA_SYSUI_PROXY)); @@ -133,16 +134,19 @@ public class TouchInteractionService extends Service implements sIsInitialized = true; } + @BinderThread @Override public void onOverviewToggle() { mOverviewCommandHelper.onOverviewToggle(); } + @BinderThread @Override public void onOverviewShown(boolean triggeredFromAltTab) { mOverviewCommandHelper.onOverviewShown(triggeredFromAltTab); } + @BinderThread @Override public void onOverviewHidden(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) { if (triggeredFromAltTab && !triggeredFromHomeKey) { @@ -151,23 +155,27 @@ public class TouchInteractionService extends Service implements } } + @BinderThread @Override public void onTip(int actionType, int viewType) { mOverviewCommandHelper.onTip(actionType, viewType); } + @BinderThread @Override public void onAssistantAvailable(boolean available) { MAIN_EXECUTOR.execute(() -> mDeviceState.setAssistantAvailable(available)); MAIN_EXECUTOR.execute(TouchInteractionService.this::onAssistantVisibilityChanged); } + @BinderThread @Override public void onAssistantVisibilityChanged(float visibility) { MAIN_EXECUTOR.execute(() -> mDeviceState.setAssistantVisibility(visibility)); MAIN_EXECUTOR.execute(TouchInteractionService.this::onAssistantVisibilityChanged); } + @BinderThread public void onBackAction(boolean completed, int downX, int downY, boolean isButton, boolean gestureSwipeLeft) { if (mOverviewComponentObserver == null) { @@ -184,11 +192,13 @@ public class TouchInteractionService extends Service implements } } + @BinderThread public void onSystemUiStateChanged(int stateFlags) { MAIN_EXECUTOR.execute(() -> mDeviceState.setSystemUiFlags(stateFlags)); MAIN_EXECUTOR.execute(TouchInteractionService.this::onSystemUiFlagsChanged); } + @BinderThread public void onActiveNavBarRegionChanges(Region region) { MAIN_EXECUTOR.execute(() -> mDeviceState.setDeferredGestureRegion(region)); } @@ -314,10 +324,12 @@ public class TouchInteractionService extends Service implements resetHomeBounceSeenOnQuickstepEnabledFirstTime(); } + @UiThread public void onUserUnlocked() { mRecentsModel = RecentsModel.INSTANCE.get(this); mOverviewComponentObserver = new OverviewComponentObserver(this, mDeviceState); - mOverviewCommandHelper = new OverviewCommandHelper(this, mOverviewComponentObserver); + mOverviewCommandHelper = new OverviewCommandHelper(this, mDeviceState, + mOverviewComponentObserver); mInputConsumer = InputConsumerController.getRecentsAnimationInputConsumer(); sSwipeSharedState.setOverviewComponentObserver(mOverviewComponentObserver); diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java index 69928f3a2c..ccc41e3de0 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java @@ -75,12 +75,10 @@ import com.android.quickstep.ActivityControlHelper.AnimationFactory; import com.android.quickstep.ActivityControlHelper.AnimationFactory.ShelfAnimState; import com.android.quickstep.ActivityControlHelper.HomeAnimationFactory; import com.android.quickstep.SysUINavigationMode.Mode; -import com.android.quickstep.inputconsumers.InputConsumer; import com.android.quickstep.inputconsumers.OverviewInputConsumer; import com.android.quickstep.util.ActiveGestureLog; import com.android.quickstep.util.AppWindowAnimationHelper.TargetAlphaProvider; import com.android.quickstep.util.RectFSpringAnim; -import com.android.quickstep.util.RecentsAnimationTargets; import com.android.quickstep.views.LiveTileOverlay; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; @@ -594,8 +592,8 @@ public class WindowTransformSwipeHandler : centermostTask.getThumbnail().getSysUiStatusNavFlags(); boolean useHomeScreenFlags = windowProgress > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD; // We will handle the sysui flags based on the centermost task view. - if (mRecentsAnimationWrapper != null) { - mRecentsAnimationWrapper.setWindowThresholdCrossed(centermostTaskFlags != 0 + if (mRecentsAnimationController != null) { + mRecentsAnimationController.setWindowThresholdCrossed(centermostTaskFlags != 0 || useHomeScreenFlags); } int sysuiFlags = useHomeScreenFlags ? 0 : centermostTaskFlags; @@ -604,14 +602,14 @@ public class WindowTransformSwipeHandler } @Override - public void onRecentsAnimationStart(RecentsAnimationWrapper controller, - RecentsAnimationTargets targetSet) { - ActiveGestureLog.INSTANCE.addLog("startRecentsAnimationCallback", targetSet.apps.length); - super.onRecentsAnimationStart(controller, targetSet); + public void onRecentsAnimationStart(RecentsAnimationController controller, + RecentsAnimationTargets targets) { + ActiveGestureLog.INSTANCE.addLog("startRecentsAnimationCallback", targets.apps.length); + super.onRecentsAnimationStart(controller, targets); // Only add the callback to enable the input consumer after we actually have the controller mStateCallback.addCallback(STATE_APP_CONTROLLER_RECEIVED | STATE_GESTURE_STARTED, - mRecentsAnimationWrapper::enableInputConsumer); + mRecentsAnimationController::enableInputConsumer); setStateOnUiThread(STATE_APP_CONTROLLER_RECEIVED); mPassedOverviewThreshold = false; @@ -813,8 +811,8 @@ public class WindowTransformSwipeHandler } } - if (endTarget.isLauncher && mRecentsAnimationWrapper != null) { - mRecentsAnimationWrapper.enableInputProxy(mInputConsumer, + if (endTarget.isLauncher && mRecentsAnimationController != null) { + mRecentsAnimationController.enableInputProxy(mInputConsumer, this::createNewInputProxyHandler); } @@ -1022,7 +1020,7 @@ public class WindowTransformSwipeHandler @UiThread private void resumeLastTask() { - mRecentsAnimationWrapper.finish(false /* toRecents */, null); + mRecentsAnimationController.finish(false /* toRecents */, null); ActiveGestureLog.INSTANCE.addLog("finishRecentsAnimation", false); doLogGesture(LAST_TASK); reset(); @@ -1113,10 +1111,10 @@ public class WindowTransformSwipeHandler private void switchToScreenshot() { if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { - if (mRecentsAnimationWrapper != null) { + if (mRecentsAnimationController != null) { // Update the screenshot of the task if (mTaskSnapshot == null) { - mTaskSnapshot = mRecentsAnimationWrapper.screenshotTask(mRunningTaskId); + mTaskSnapshot = mRecentsAnimationController.screenshotTask(mRunningTaskId); } mRecentsView.updateThumbnail(mRunningTaskId, mTaskSnapshot, false /* refreshNow */); } @@ -1126,10 +1124,10 @@ public class WindowTransformSwipeHandler setStateOnUiThread(STATE_SCREENSHOT_CAPTURED); } else { boolean finishTransitionPosted = false; - if (mRecentsAnimationWrapper != null) { + if (mRecentsAnimationController != null) { // Update the screenshot of the task if (mTaskSnapshot == null) { - mTaskSnapshot = mRecentsAnimationWrapper.screenshotTask(mRunningTaskId); + mTaskSnapshot = mRecentsAnimationController.screenshotTask(mRunningTaskId); } final TaskView taskView; if (mGestureEndTarget == HOME) { @@ -1162,8 +1160,8 @@ public class WindowTransformSwipeHandler // If there are no targets, then there is nothing to finish setStateOnUiThread(STATE_CURRENT_TASK_FINISHED); } else { - synchronized (mRecentsAnimationWrapper) { - mRecentsAnimationWrapper.finish(true /* toRecents */, + synchronized (mRecentsAnimationController) { + mRecentsAnimationController.finish(true /* toRecents */, () -> setStateOnUiThread(STATE_CURRENT_TASK_FINISHED)); } } @@ -1171,8 +1169,8 @@ public class WindowTransformSwipeHandler } private void finishCurrentTransitionToHome() { - synchronized (mRecentsAnimationWrapper) { - mRecentsAnimationWrapper.finish(true /* toRecents */, + synchronized (mRecentsAnimationController) { + mRecentsAnimationController.finish(true /* toRecents */, () -> setStateOnUiThread(STATE_CURRENT_TASK_FINISHED), true /* sendUserLeaveHint */); } @@ -1183,8 +1181,8 @@ public class WindowTransformSwipeHandler private void setupLauncherUiAfterSwipeUpToRecentsAnimation() { endLauncherTransitionController(); mActivityControlHelper.onSwipeUpToRecentsComplete(mActivity); - if (mRecentsAnimationWrapper != null) { - mRecentsAnimationWrapper.setDeferCancelUntilNextTransition(true /* defer */, + if (mRecentsAnimationController != null) { + mRecentsAnimationController.setDeferCancelUntilNextTransition(true /* defer */, true /* screenshot */); } mRecentsView.onSwipeUpAnimationSuccess(); diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/AccessibilityInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/AccessibilityInputConsumer.java index f9bbd37abb..d3765c5334 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/AccessibilityInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/AccessibilityInputConsumer.java @@ -29,6 +29,7 @@ import android.view.VelocityTracker; import android.view.ViewConfiguration; import com.android.launcher3.R; +import com.android.quickstep.InputConsumer; import com.android.quickstep.RecentsAnimationDeviceState; import com.android.quickstep.util.MotionPauseDetector; import com.android.quickstep.SystemUiProxy; diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/AssistantInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/AssistantInputConsumer.java index 7cc29e4cc3..d60b92718a 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/AssistantInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/AssistantInputConsumer.java @@ -49,6 +49,7 @@ import com.android.launcher3.R; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.logging.UserEventDispatcher; import com.android.quickstep.ActivityControlHelper; +import com.android.quickstep.InputConsumer; import com.android.quickstep.SystemUiProxy; import com.android.systemui.shared.system.InputMonitorCompat; diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/DelegateInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/DelegateInputConsumer.java index 311ddd27ca..0b5129c079 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/DelegateInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/DelegateInputConsumer.java @@ -2,6 +2,7 @@ package com.android.quickstep.inputconsumers; import android.view.MotionEvent; +import com.android.quickstep.InputConsumer; import com.android.systemui.shared.system.InputMonitorCompat; public abstract class DelegateInputConsumer implements InputConsumer { diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java index 2d95d758bc..cdf2e26bc5 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java @@ -39,15 +39,15 @@ import android.view.ViewConfiguration; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.util.DefaultDisplay; +import com.android.quickstep.InputConsumer; import com.android.quickstep.LockScreenRecentsActivity; import com.android.quickstep.MultiStateCallback; +import com.android.quickstep.RecentsAnimationController; import com.android.quickstep.RecentsAnimationDeviceState; -import com.android.quickstep.RecentsAnimationWrapper; import com.android.quickstep.SwipeSharedState; +import com.android.quickstep.RecentsAnimationCallbacks; +import com.android.quickstep.RecentsAnimationTargets; import com.android.quickstep.util.AppWindowAnimationHelper; -import com.android.quickstep.util.RecentsAnimationCallbacks; -import com.android.quickstep.util.RecentsAnimationTargets; - import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.InputMonitorCompat; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; @@ -92,7 +92,7 @@ public class DeviceLockedInputConsumer implements InputConsumer, private boolean mThresholdCrossed = false; - private RecentsAnimationWrapper mRecentsAnimationController; + private RecentsAnimationController mRecentsAnimationController; private RecentsAnimationTargets mRecentsAnimationTargets; public DeviceLockedInputConsumer(Context context, RecentsAnimationDeviceState deviceState, @@ -204,9 +204,8 @@ public class DeviceLockedInputConsumer implements InputConsumer, private void startRecentsTransition() { mThresholdCrossed = true; - RecentsAnimationCallbacks newListenerSet = - mSwipeSharedState.newRecentsAnimationListenerSet(); - newListenerSet.addListener(this); + RecentsAnimationCallbacks callbacks = mSwipeSharedState.newRecentsAnimationCallbacks(); + callbacks.addListener(this); Intent intent = new Intent(Intent.ACTION_MAIN) .addCategory(Intent.CATEGORY_DEFAULT) .setComponent(new ComponentName(mContext, LockScreenRecentsActivity.class)) @@ -214,17 +213,17 @@ public class DeviceLockedInputConsumer implements InputConsumer, .putExtra(INTENT_EXTRA_LOG_TRACE_ID, mLogId); mInputMonitorCompat.pilferPointers(); - startRecentsActivityAsync(intent, newListenerSet); + startRecentsActivityAsync(intent, callbacks); } @Override - public void onRecentsAnimationStart(RecentsAnimationWrapper controller, - RecentsAnimationTargets targetSet) { + public void onRecentsAnimationStart(RecentsAnimationController controller, + RecentsAnimationTargets targets) { mRecentsAnimationController = controller; - mRecentsAnimationTargets = targetSet; + mRecentsAnimationTargets = targets; Rect displaySize = new Rect(0, 0, mDisplaySize.x, mDisplaySize.y); - RemoteAnimationTargetCompat targetCompat = targetSet.findTask(mRunningTaskId); + RemoteAnimationTargetCompat targetCompat = targets.findTask(mRunningTaskId); if (targetCompat != null) { mAppWindowAnimationHelper.updateSource(displaySize, targetCompat); } diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/FallbackNoButtonInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/FallbackNoButtonInputConsumer.java index 4d9ed5324a..29357f237d 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/FallbackNoButtonInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/FallbackNoButtonInputConsumer.java @@ -42,15 +42,16 @@ import com.android.launcher3.util.ObjectWrapper; import com.android.quickstep.ActivityControlHelper.HomeAnimationFactory; import com.android.quickstep.AnimatedFloat; import com.android.quickstep.BaseSwipeUpHandler; +import com.android.quickstep.InputConsumer; import com.android.quickstep.MultiStateCallback; import com.android.quickstep.OverviewComponentObserver; import com.android.quickstep.RecentsActivity; -import com.android.quickstep.RecentsAnimationWrapper; +import com.android.quickstep.RecentsAnimationController; import com.android.quickstep.RecentsModel; import com.android.quickstep.SwipeSharedState; import com.android.quickstep.fallback.FallbackRecentsView; import com.android.quickstep.util.RectFSpringAnim; -import com.android.quickstep.util.RecentsAnimationTargets; +import com.android.quickstep.RecentsAnimationTargets; import com.android.quickstep.views.TaskView; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.ActivityManagerWrapper; @@ -232,8 +233,8 @@ public class FallbackNoButtonInputConsumer extends @Override public void updateFinalShift() { mTransformParams.setProgress(mCurrentShift.value); - if (mRecentsAnimationWrapper != null) { - mRecentsAnimationWrapper.setWindowThresholdCrossed(!mInQuickSwitchMode + if (mRecentsAnimationController != null) { + mRecentsAnimationController.setWindowThresholdCrossed(!mInQuickSwitchMode && (mCurrentShift.value > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD)); } if (mRecentsAnimationTargets != null) { @@ -319,25 +320,25 @@ public class FallbackNoButtonInputConsumer extends switch (mEndTarget) { case HOME: { if (mSwipeUpOverHome) { - mRecentsAnimationWrapper.finish(false, null, false); + mRecentsAnimationController.finish(false, null, false); // Send a home intent to clear the task stack mContext.startActivity(mOverviewComponentObserver.getHomeIntent()); } else { - mRecentsAnimationWrapper.finish(true, null, true); + mRecentsAnimationController.finish(true, null, true); } break; } case LAST_TASK: - mRecentsAnimationWrapper.finish(false, null, false); + mRecentsAnimationController.finish(false, null, false); break; case RECENTS: { if (mSwipeUpOverHome) { - mRecentsAnimationWrapper.finish(true, null, true); + mRecentsAnimationController.finish(true, null, true); break; } - ThumbnailData thumbnail = mRecentsAnimationWrapper.screenshotTask(mRunningTaskId); - mRecentsAnimationWrapper.setDeferCancelUntilNextTransition(true /* defer */, + ThumbnailData thumbnail = mRecentsAnimationController.screenshotTask(mRunningTaskId); + mRecentsAnimationController.setDeferCancelUntilNextTransition(true /* defer */, false /* screenshot */); ActivityOptions options = ActivityOptions.makeCustomAnimation(mContext, 0, 0); @@ -350,7 +351,7 @@ public class FallbackNoButtonInputConsumer extends Intent intent = new Intent(mOverviewComponentObserver.getOverviewIntent()) .putExtras(extras); mContext.startActivity(intent, options.toBundle()); - mRecentsAnimationWrapper.cleanupScreenshot(); + mRecentsAnimationController.cleanupScreenshot(); break; } case NEW_TASK: { @@ -416,10 +417,10 @@ public class FallbackNoButtonInputConsumer extends } @Override - public void onRecentsAnimationStart(RecentsAnimationWrapper controller, - RecentsAnimationTargets targetSet) { - super.onRecentsAnimationStart(controller, targetSet); - mRecentsAnimationWrapper.enableInputConsumer(); + public void onRecentsAnimationStart(RecentsAnimationController controller, + RecentsAnimationTargets targets) { + super.onRecentsAnimationStart(controller, targets); + mRecentsAnimationController.enableInputConsumer(); if (mRunningOverHome) { mAppWindowAnimationHelper.prepareAnimation(mDp, true); diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java index 3e66d7b1a4..d5a18043ab 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java @@ -53,6 +53,7 @@ import com.android.launcher3.util.TraceHelper; import com.android.quickstep.ActivityControlHelper; import com.android.quickstep.BaseSwipeUpHandler; import com.android.quickstep.BaseSwipeUpHandler.Factory; +import com.android.quickstep.InputConsumer; import com.android.quickstep.RecentsAnimationDeviceState; import com.android.quickstep.SwipeSharedState; import com.android.quickstep.SysUINavigationMode; @@ -61,7 +62,7 @@ import com.android.quickstep.util.ActiveGestureLog; import com.android.quickstep.util.CachedEventDispatcher; import com.android.quickstep.util.MotionPauseDetector; import com.android.quickstep.util.NavBarPosition; -import com.android.quickstep.util.RecentsAnimationCallbacks; +import com.android.quickstep.RecentsAnimationCallbacks; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.InputMonitorCompat; @@ -343,12 +344,11 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC mSwipeSharedState.applyActiveRecentsAnimationState(handler); notifyGestureStarted(); } else { - RecentsAnimationCallbacks newListenerSet = - mSwipeSharedState.newRecentsAnimationListenerSet(); - newListenerSet.addListener(handler); + RecentsAnimationCallbacks callbacks = mSwipeSharedState.newRecentsAnimationCallbacks(); + callbacks.addListener(handler); Intent intent = handler.getLaunchIntent(); intent.putExtra(INTENT_EXTRA_LOG_TRACE_ID, mLogId); - startRecentsActivityAsync(intent, newListenerSet); + startRecentsActivityAsync(intent, callbacks); } } diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java index 74e457c686..b09a5ac1c1 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java @@ -27,6 +27,7 @@ import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.Utilities; import com.android.launcher3.views.BaseDragLayer; import com.android.quickstep.ActivityControlHelper; +import com.android.quickstep.InputConsumer; import com.android.quickstep.util.ActiveGestureLog; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.InputMonitorCompat; diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java index 03e0ae77e5..c2560946c3 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java @@ -36,6 +36,7 @@ import com.android.launcher3.logging.StatsLogUtils; import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction; import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch; import com.android.quickstep.ActivityControlHelper; +import com.android.quickstep.InputConsumer; import com.android.quickstep.util.ActiveGestureLog; import com.android.quickstep.util.NavBarPosition; import com.android.systemui.shared.system.ActivityManagerWrapper; diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/QuickCaptureInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/QuickCaptureInputConsumer.java index ad9405f478..ea80a383bd 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/QuickCaptureInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/QuickCaptureInputConsumer.java @@ -36,6 +36,7 @@ import android.view.ViewConfiguration; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.R; import com.android.quickstep.ActivityControlHelper; +import com.android.quickstep.InputConsumer; import com.android.quickstep.views.RecentsView; import com.android.systemui.shared.system.InputMonitorCompat; diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/ResetGestureInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/ResetGestureInputConsumer.java index 8eede81b84..e04c0c741c 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/ResetGestureInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/ResetGestureInputConsumer.java @@ -17,6 +17,7 @@ package com.android.quickstep.inputconsumers; import android.view.MotionEvent; +import com.android.quickstep.InputConsumer; import com.android.quickstep.SwipeSharedState; /** diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/ScreenPinnedInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/ScreenPinnedInputConsumer.java index cfd9d91428..d8b1bfdcfd 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/ScreenPinnedInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/ScreenPinnedInputConsumer.java @@ -22,6 +22,7 @@ import android.view.MotionEvent; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.R; import com.android.quickstep.ActivityControlHelper; +import com.android.quickstep.InputConsumer; import com.android.quickstep.util.MotionPauseDetector; import com.android.quickstep.SystemUiProxy; diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/AppWindowAnimationHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/AppWindowAnimationHelper.java index c03580917c..5eee897350 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/AppWindowAnimationHelper.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/AppWindowAnimationHelper.java @@ -35,6 +35,7 @@ import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.DeviceProfile; import com.android.launcher3.LauncherState; import com.android.launcher3.R; +import com.android.quickstep.RemoteAnimationTargets; import com.android.quickstep.SystemUiProxy; import com.android.launcher3.Utilities; import com.android.launcher3.views.BaseDragLayer; diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java index 6a6043cec7..764e0f314f 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/LauncherRecentsView.java @@ -220,7 +220,7 @@ public class LauncherRecentsView extends RecentsView implements StateL @Override public AppWindowAnimationHelper.TransformParams getLiveTileParams( boolean mightNeedToRefill) { - if (!mEnableDrawingLiveTile || mRecentsAnimationWrapper == null + if (!mEnableDrawingLiveTile || mRecentsAnimationController == null || mRecentsAnimationTargets == null || mAppWindowAnimationHelper == null) { return null; } diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java index 67cd3d6bd8..ea0699159b 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java @@ -101,14 +101,14 @@ import com.android.launcher3.util.OverScroller; import com.android.launcher3.util.PendingAnimation; import com.android.launcher3.util.Themes; import com.android.launcher3.util.ViewPool; -import com.android.quickstep.RecentsAnimationWrapper; +import com.android.quickstep.RecentsAnimationController; import com.android.quickstep.RecentsModel; import com.android.quickstep.RecentsModel.TaskThumbnailChangeListener; import com.android.quickstep.TaskThumbnailCache; import com.android.quickstep.TaskUtils; import com.android.quickstep.ViewUtils; import com.android.quickstep.util.AppWindowAnimationHelper; -import com.android.quickstep.util.RecentsAnimationTargets; +import com.android.quickstep.RecentsAnimationTargets; import com.android.systemui.shared.recents.model.Task; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.ActivityManagerWrapper; @@ -156,7 +156,7 @@ public abstract class RecentsView extends PagedView impl } }; - protected RecentsAnimationWrapper mRecentsAnimationWrapper; + protected RecentsAnimationController mRecentsAnimationController; protected RecentsAnimationTargets mRecentsAnimationTargets; protected AppWindowAnimationHelper mAppWindowAnimationHelper; protected SyncRtSurfaceTransactionApplierCompat mSyncTransactionApplier; @@ -809,7 +809,7 @@ public abstract class RecentsView extends PagedView impl mIgnoreResetTaskId = -1; mTaskListChangeId = -1; - mRecentsAnimationWrapper = null; + mRecentsAnimationController = null; mRecentsAnimationTargets = null; mAppWindowAnimationHelper = null; @@ -1696,9 +1696,9 @@ public abstract class RecentsView extends PagedView impl public void redrawLiveTile(boolean mightNeedToRefill) { } // TODO: To be removed in a follow up CL - public void setRecentsAnimationTargets(RecentsAnimationWrapper recentsAnimationWrapper, + public void setRecentsAnimationTargets(RecentsAnimationController recentsAnimationController, RecentsAnimationTargets recentsAnimationTargets) { - mRecentsAnimationWrapper = recentsAnimationWrapper; + mRecentsAnimationController = recentsAnimationController; mRecentsAnimationTargets = recentsAnimationTargets; } @@ -1718,14 +1718,14 @@ public abstract class RecentsView extends PagedView impl } public void finishRecentsAnimation(boolean toRecents, Runnable onFinishComplete) { - if (mRecentsAnimationWrapper == null) { + if (mRecentsAnimationController == null) { if (onFinishComplete != null) { onFinishComplete.run(); } return; } - mRecentsAnimationWrapper.finish(toRecents, onFinishComplete); + mRecentsAnimationController.finish(toRecents, onFinishComplete); } public void setDisallowScrollToClearAll(boolean disallowScrollToClearAll) { diff --git a/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java index af75364023..d4db05a6c6 100644 --- a/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java +++ b/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java @@ -71,7 +71,7 @@ import com.android.launcher3.util.MultiValueAlpha.AlphaProperty; import com.android.launcher3.views.FloatingIconView; import com.android.quickstep.util.MultiValueUpdateListener; import com.android.quickstep.util.RemoteAnimationProvider; -import com.android.quickstep.util.RemoteAnimationTargets; +import com.android.quickstep.RemoteAnimationTargets; import com.android.systemui.shared.system.ActivityCompat; import com.android.systemui.shared.system.ActivityOptionsCompat; import com.android.systemui.shared.system.QuickStepContract; diff --git a/quickstep/src/com/android/quickstep/ActivityControlHelper.java b/quickstep/src/com/android/quickstep/ActivityControlHelper.java index 132d6abe14..382232cda2 100644 --- a/quickstep/src/com/android/quickstep/ActivityControlHelper.java +++ b/quickstep/src/com/android/quickstep/ActivityControlHelper.java @@ -32,7 +32,6 @@ import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.DeviceProfile; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.quickstep.util.ActivityInitListener; -import com.android.quickstep.util.RemoteAnimationTargets; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/InputConsumer.java b/quickstep/src/com/android/quickstep/InputConsumer.java similarity index 98% rename from quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/InputConsumer.java rename to quickstep/src/com/android/quickstep/InputConsumer.java index 045bafec03..62c0ded534 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/InputConsumer.java +++ b/quickstep/src/com/android/quickstep/InputConsumer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.quickstep.inputconsumers; +package com.android.quickstep; import android.annotation.TargetApi; import android.os.Build; diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationCallbacks.java b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java similarity index 88% rename from quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationCallbacks.java rename to quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java index 824b34dd05..2918879d74 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationCallbacks.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.quickstep.util; +package com.android.quickstep; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; @@ -25,8 +25,6 @@ import androidx.annotation.UiThread; import com.android.launcher3.Utilities; import com.android.launcher3.util.Preconditions; -import com.android.quickstep.TouchInteractionService; -import com.android.quickstep.RecentsAnimationWrapper; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.RecentsAnimationControllerCompat; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; @@ -44,7 +42,7 @@ public class RecentsAnimationCallbacks implements private final boolean mShouldMinimizeSplitScreen; // TODO(141886704): Remove these references when they are no longer needed - private RecentsAnimationWrapper mController; + private RecentsAnimationController mController; private boolean mCancelled; @@ -85,10 +83,10 @@ public class RecentsAnimationCallbacks implements RemoteAnimationTargetCompat[] appTargets, RemoteAnimationTargetCompat[] wallpaperTargets, Rect homeContentInsets, Rect minimizedHomeBounds) { - RecentsAnimationTargets targetSet = new RecentsAnimationTargets(appTargets, + RecentsAnimationTargets targets = new RecentsAnimationTargets(appTargets, wallpaperTargets, homeContentInsets, minimizedHomeBounds); - mController = new RecentsAnimationWrapper(animationController, mShouldMinimizeSplitScreen, - this::onAnimationFinished); + mController = new RecentsAnimationController(animationController, + mShouldMinimizeSplitScreen, this::onAnimationFinished); if (mCancelled) { Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), @@ -96,7 +94,7 @@ public class RecentsAnimationCallbacks implements } else { Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> { for (RecentsAnimationListener listener : getListeners()) { - listener.onRecentsAnimationStart(mController, targetSet); + listener.onRecentsAnimationStart(mController, targets); } }); } @@ -112,7 +110,7 @@ public class RecentsAnimationCallbacks implements }); } - private final void onAnimationFinished(RecentsAnimationWrapper controller) { + private final void onAnimationFinished(RecentsAnimationController controller) { Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> { for (RecentsAnimationListener listener : getListeners()) { listener.onRecentsAnimationFinished(controller); @@ -128,7 +126,7 @@ public class RecentsAnimationCallbacks implements * Listener for the recents animation callbacks. */ public interface RecentsAnimationListener { - default void onRecentsAnimationStart(RecentsAnimationWrapper controller, + default void onRecentsAnimationStart(RecentsAnimationController controller, RecentsAnimationTargets targetSet) {} /** @@ -137,6 +135,6 @@ public class RecentsAnimationCallbacks implements */ default void onRecentsAnimationCanceled(ThumbnailData thumbnailData) {} - default void onRecentsAnimationFinished(RecentsAnimationWrapper controller) {} + default void onRecentsAnimationFinished(RecentsAnimationController controller) {} } } diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/RecentsAnimationWrapper.java b/quickstep/src/com/android/quickstep/RecentsAnimationController.java similarity index 94% rename from quickstep/recents_ui_overrides/src/com/android/quickstep/RecentsAnimationWrapper.java rename to quickstep/src/com/android/quickstep/RecentsAnimationController.java index 72aa0e79f6..d938dc5af8 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/RecentsAnimationWrapper.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationController.java @@ -30,12 +30,8 @@ import android.view.MotionEvent; import androidx.annotation.UiThread; import com.android.launcher3.util.Preconditions; -import com.android.quickstep.inputconsumers.InputConsumer; -import com.android.quickstep.util.RecentsAnimationCallbacks; -import com.android.quickstep.util.RecentsAnimationTargets; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.InputConsumerController; - import com.android.systemui.shared.system.RecentsAnimationControllerCompat; import java.util.function.Consumer; @@ -44,12 +40,12 @@ import java.util.function.Supplier; /** * Wrapper around RecentsAnimationController to help with some synchronization */ -public class RecentsAnimationWrapper { +public class RecentsAnimationController { - private static final String TAG = "RecentsAnimationWrapper"; + private static final String TAG = "RecentsAnimationController"; private final RecentsAnimationControllerCompat mController; - private final Consumer mOnFinishedListener; + private final Consumer mOnFinishedListener; private final boolean mShouldMinimizeSplitScreen; private boolean mWindowThresholdCrossed = false; @@ -60,9 +56,9 @@ public class RecentsAnimationWrapper { private boolean mTouchInProgress; private boolean mFinishPending; - public RecentsAnimationWrapper(RecentsAnimationControllerCompat controller, + public RecentsAnimationController(RecentsAnimationControllerCompat controller, boolean shouldMinimizeSplitScreen, - Consumer onFinishedListener) { + Consumer onFinishedListener) { mController = controller; mOnFinishedListener = onFinishedListener; mShouldMinimizeSplitScreen = shouldMinimizeSplitScreen; diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationTargets.java b/quickstep/src/com/android/quickstep/RecentsAnimationTargets.java similarity index 98% rename from quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationTargets.java rename to quickstep/src/com/android/quickstep/RecentsAnimationTargets.java index 4013e92bfe..93537597d5 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationTargets.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationTargets.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.quickstep.util; +package com.android.quickstep; import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING; diff --git a/quickstep/src/com/android/quickstep/util/RemoteAnimationTargets.java b/quickstep/src/com/android/quickstep/RemoteAnimationTargets.java similarity index 98% rename from quickstep/src/com/android/quickstep/util/RemoteAnimationTargets.java rename to quickstep/src/com/android/quickstep/RemoteAnimationTargets.java index f971c47d2e..5fa6bc79e1 100644 --- a/quickstep/src/com/android/quickstep/util/RemoteAnimationTargets.java +++ b/quickstep/src/com/android/quickstep/RemoteAnimationTargets.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.quickstep.util; +package com.android.quickstep; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat; diff --git a/quickstep/src/com/android/quickstep/util/RemoteFadeOutAnimationListener.java b/quickstep/src/com/android/quickstep/util/RemoteFadeOutAnimationListener.java index 7f6aba9925..fa2d3387f4 100644 --- a/quickstep/src/com/android/quickstep/util/RemoteFadeOutAnimationListener.java +++ b/quickstep/src/com/android/quickstep/util/RemoteFadeOutAnimationListener.java @@ -21,6 +21,7 @@ import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MOD import android.animation.ValueAnimator; import android.animation.ValueAnimator.AnimatorUpdateListener; +import com.android.quickstep.RemoteAnimationTargets; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import com.android.systemui.shared.system.TransactionCompat;