From a18e285fe75a90aa0381900d0e7562dff208cc72 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Wed, 19 Oct 2022 16:16:10 -0700 Subject: [PATCH] Removing unnecessary RemoteAnimationTargetCompat Bug: 221961069 Test: Presubmit Change-Id: I12a4c29eaf9bd7d97d3c02074b4cc1ca452fc88a --- .../launcher3/LauncherAnimationRunner.java | 24 ++-- .../launcher3/LauncherInitListener.java | 6 +- .../launcher3/QuickstepTransitionManager.java | 114 +++++++++--------- .../uioverrides/QuickstepLauncher.java | 6 +- .../android/quickstep/AbsSwipeUpHandler.java | 30 ++--- .../quickstep/BaseActivityInterface.java | 4 +- .../quickstep/FallbackActivityInterface.java | 4 +- .../quickstep/FallbackSwipeHandler.java | 28 ++--- .../com/android/quickstep/GestureState.java | 6 +- .../quickstep/LauncherActivityInterface.java | 4 +- .../LauncherBackAnimationController.java | 9 +- .../quickstep/LauncherSwipeHandlerV2.java | 6 +- .../android/quickstep/RecentsActivity.java | 27 +++-- .../quickstep/RecentsAnimationCallbacks.java | 25 ++-- .../quickstep/RecentsAnimationController.java | 4 +- .../quickstep/RecentsAnimationTargets.java | 9 +- .../quickstep/RemoteAnimationTargets.java | 63 +++++----- .../android/quickstep/RemoteTargetGluer.java | 29 +++-- .../quickstep/SwipeUpAnimationLogic.java | 4 +- .../com/android/quickstep/SystemUiProxy.java | 2 + .../quickstep/TaskAnimationManager.java | 33 +++-- .../src/com/android/quickstep/TaskUtils.java | 6 +- .../com/android/quickstep/TaskViewUtils.java | 41 ++++--- .../DeviceLockedInputConsumer.java | 4 +- .../util/RemoteAnimationProvider.java | 13 +- .../util/RemoteFadeOutAnimationListener.java | 14 +-- .../util/SplitSelectStateController.java | 6 +- .../quickstep/util/TaskViewSimulator.java | 13 +- .../quickstep/util/TransformParams.java | 22 ++-- .../quickstep/views/FloatingWidgetView.java | 4 +- .../android/quickstep/views/RecentsView.java | 6 +- .../com/android/quickstep/views/TaskView.java | 10 +- .../quickstep/util/TaskViewSimulatorTest.java | 4 +- 33 files changed, 297 insertions(+), 283 deletions(-) diff --git a/quickstep/src/com/android/launcher3/LauncherAnimationRunner.java b/quickstep/src/com/android/launcher3/LauncherAnimationRunner.java index 62603e9d54..880aa6f97b 100644 --- a/quickstep/src/com/android/launcher3/LauncherAnimationRunner.java +++ b/quickstep/src/com/android/launcher3/LauncherAnimationRunner.java @@ -28,13 +28,13 @@ import android.annotation.TargetApi; import android.content.Context; import android.os.Build; import android.os.Handler; +import android.view.RemoteAnimationTarget; import androidx.annotation.BinderThread; import androidx.annotation.Nullable; import androidx.annotation.UiThread; import com.android.systemui.shared.system.RemoteAnimationRunnerCompat; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.lang.ref.WeakReference; @@ -82,9 +82,9 @@ public class LauncherAnimationRunner implements RemoteAnimationRunnerCompat { @BinderThread public void onAnimationStart( int transit, - RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets, - RemoteAnimationTargetCompat[] nonAppTargets, + RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets, + RemoteAnimationTarget[] nonAppTargets, Runnable runnable) { Runnable r = () -> { finishExistingAnimation(); @@ -101,17 +101,17 @@ public class LauncherAnimationRunner implements RemoteAnimationRunnerCompat { // Called only in R platform @BinderThread - public void onAnimationStart(RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets, Runnable runnable) { + public void onAnimationStart(RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets, Runnable runnable) { onAnimationStart(0 /* transit */, appTargets, wallpaperTargets, - new RemoteAnimationTargetCompat[0], runnable); + new RemoteAnimationTarget[0], runnable); } // Called only in Q platform @BinderThread @Deprecated - public void onAnimationStart(RemoteAnimationTargetCompat[] appTargets, Runnable runnable) { - onAnimationStart(appTargets, new RemoteAnimationTargetCompat[0], runnable); + public void onAnimationStart(RemoteAnimationTarget[] appTargets, Runnable runnable) { + onAnimationStart(appTargets, new RemoteAnimationTarget[0], runnable); } @@ -229,9 +229,9 @@ public class LauncherAnimationRunner implements RemoteAnimationRunnerCompat { * call {@link AnimationResult#setAnimation} with the target animation to be run. */ void onCreateAnimation(int transit, - RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets, - RemoteAnimationTargetCompat[] nonAppTargets, + RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets, + RemoteAnimationTarget[] nonAppTargets, LauncherAnimationRunner.AnimationResult result); /** diff --git a/quickstep/src/com/android/launcher3/LauncherInitListener.java b/quickstep/src/com/android/launcher3/LauncherInitListener.java index c4e85f6014..28bd701a48 100644 --- a/quickstep/src/com/android/launcher3/LauncherInitListener.java +++ b/quickstep/src/com/android/launcher3/LauncherInitListener.java @@ -19,11 +19,11 @@ import android.animation.AnimatorSet; import android.annotation.TargetApi; import android.os.Build; import android.os.CancellationSignal; +import android.view.RemoteAnimationTarget; import com.android.launcher3.uioverrides.QuickstepLauncher; import com.android.quickstep.util.ActivityInitListener; import com.android.quickstep.util.RemoteAnimationProvider; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.util.function.BiPredicate; @@ -52,8 +52,8 @@ public class LauncherInitListener extends ActivityInitListener { CancellationSignal cancellationSignal = new CancellationSignal(); appTransitionManager.setRemoteAnimationProvider(new RemoteAnimationProvider() { @Override - public AnimatorSet createWindowAnimation(RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets) { + public AnimatorSet createWindowAnimation(RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets) { // On the first call clear the reference. cancellationSignal.cancel(); diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java index e17e860cf2..a6c3933084 100644 --- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java @@ -17,6 +17,8 @@ package com.android.launcher3; import static android.provider.Settings.Secure.LAUNCHER_TASKBAR_EDUCATION_SHOWING; +import static android.view.RemoteAnimationTarget.MODE_CLOSING; +import static android.view.RemoteAnimationTarget.MODE_OPENING; import static android.window.StartingWindowInfo.STARTING_WINDOW_TYPE_NONE; import static android.window.StartingWindowInfo.STARTING_WINDOW_TYPE_SPLASH_SCREEN; @@ -50,8 +52,6 @@ import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITION import static com.android.quickstep.TaskViewUtils.findTaskViewToLaunch; import static com.android.systemui.shared.system.QuickStepContract.getWindowCornerRadius; import static com.android.systemui.shared.system.QuickStepContract.supportsRoundedCornersOnWindows; -import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING; -import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -82,6 +82,7 @@ import android.provider.Settings; import android.util.Pair; import android.util.Size; import android.view.CrossWindowBlurListeners; +import android.view.RemoteAnimationTarget; import android.view.SurfaceControl; import android.view.View; import android.view.ViewRootImpl; @@ -136,7 +137,6 @@ import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.shared.system.RemoteAnimationAdapterCompat; import com.android.systemui.shared.system.RemoteAnimationDefinitionCompat; import com.android.systemui.shared.system.RemoteAnimationRunnerCompat; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import com.android.systemui.shared.system.RemoteTransitionCompat; import com.android.wm.shell.startingsurface.IStartingWindowListener; @@ -313,7 +313,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener * @return true if the app is launching from recents, false if it most likely is not */ protected boolean isLaunchingFromRecents(@NonNull View v, - @Nullable RemoteAnimationTargetCompat[] targets) { + @Nullable RemoteAnimationTarget[] targets) { return mLauncher.getStateManager().getState().overviewUi && findTaskViewToLaunch(mLauncher.getOverviewPanel(), v, targets) != null; } @@ -327,18 +327,18 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener * @param launcherClosing true if the launcher app is closing */ protected void composeRecentsLaunchAnimator(@NonNull AnimatorSet anim, @NonNull View v, - @NonNull RemoteAnimationTargetCompat[] appTargets, - @NonNull RemoteAnimationTargetCompat[] wallpaperTargets, - @NonNull RemoteAnimationTargetCompat[] nonAppTargets, boolean launcherClosing) { + @NonNull RemoteAnimationTarget[] appTargets, + @NonNull RemoteAnimationTarget[] wallpaperTargets, + @NonNull RemoteAnimationTarget[] nonAppTargets, boolean launcherClosing) { TaskViewUtils.composeRecentsLaunchAnimator(anim, v, appTargets, wallpaperTargets, nonAppTargets, launcherClosing, mLauncher.getStateManager(), mLauncher.getOverviewPanel(), mLauncher.getDepthController()); } - private boolean areAllTargetsTranslucent(@NonNull RemoteAnimationTargetCompat[] targets) { + private boolean areAllTargetsTranslucent(@NonNull RemoteAnimationTarget[] targets) { boolean isAllOpeningTargetTrs = true; for (int i = 0; i < targets.length; i++) { - RemoteAnimationTargetCompat target = targets[i]; + RemoteAnimationTarget target = targets[i]; if (target.mode == MODE_OPENING) { isAllOpeningTargetTrs &= target.isTranslucent; } @@ -356,9 +356,9 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener * @param launcherClosing true if launcher is closing */ private void composeIconLaunchAnimator(@NonNull AnimatorSet anim, @NonNull View v, - @NonNull RemoteAnimationTargetCompat[] appTargets, - @NonNull RemoteAnimationTargetCompat[] wallpaperTargets, - @NonNull RemoteAnimationTargetCompat[] nonAppTargets, + @NonNull RemoteAnimationTarget[] appTargets, + @NonNull RemoteAnimationTarget[] wallpaperTargets, + @NonNull RemoteAnimationTarget[] nonAppTargets, boolean launcherClosing) { // Set the state animation first so that any state listeners are called // before our internal listeners. @@ -400,9 +400,9 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener private void composeWidgetLaunchAnimator( @NonNull AnimatorSet anim, @NonNull LauncherAppWidgetHostView v, - @NonNull RemoteAnimationTargetCompat[] appTargets, - @NonNull RemoteAnimationTargetCompat[] wallpaperTargets, - @NonNull RemoteAnimationTargetCompat[] nonAppTargets) { + @NonNull RemoteAnimationTarget[] appTargets, + @NonNull RemoteAnimationTarget[] wallpaperTargets, + @NonNull RemoteAnimationTarget[] nonAppTargets) { mLauncher.getStateManager().setCurrentAnimation(anim); Rect windowTargetBounds = getWindowTargetBounds(appTargets, getRotationChange(appTargets)); @@ -425,10 +425,10 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener * In multiwindow mode, we need to get the final size of the opening app window target to help * figure out where the floating view should animate to. */ - private Rect getWindowTargetBounds(@NonNull RemoteAnimationTargetCompat[] appTargets, + private Rect getWindowTargetBounds(@NonNull RemoteAnimationTarget[] appTargets, int rotationChange) { - RemoteAnimationTargetCompat target = null; - for (RemoteAnimationTargetCompat t : appTargets) { + RemoteAnimationTarget target = null; + for (RemoteAnimationTarget t : appTargets) { if (t.mode != MODE_OPENING) continue; target = t; break; @@ -650,9 +650,9 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener * @return Animator that controls the window of the opening targets from app icons. */ private Animator getOpeningWindowAnimators(View v, - RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets, - RemoteAnimationTargetCompat[] nonAppTargets, + RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets, + RemoteAnimationTarget[] nonAppTargets, Rect windowTargetBounds, boolean appTargetsAreTranslucent, int rotationChange) { RectF launcherIconBounds = new RectF(); FloatingIconView floatingView = FloatingIconView.getFloatingIconView(mLauncher, v, @@ -665,7 +665,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener SurfaceTransactionApplier surfaceApplier = new SurfaceTransactionApplier(floatingView); openingTargets.addReleaseCheck(surfaceApplier); - RemoteAnimationTargetCompat navBarTarget = openingTargets.getNavBarRemoteAnimationTarget(); + RemoteAnimationTarget navBarTarget = openingTargets.getNavBarRemoteAnimationTarget(); int[] dragLayerBounds = new int[2]; mDragLayer.getLocationOnScreen(dragLayerBounds); @@ -820,7 +820,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener SurfaceTransaction transaction = new SurfaceTransaction(); for (int i = appTargets.length - 1; i >= 0; i--) { - RemoteAnimationTargetCompat target = appTargets[i]; + RemoteAnimationTarget target = appTargets[i]; SurfaceProperties builder = transaction.forSurface(target.leash); if (target.mode == MODE_OPENING) { @@ -903,9 +903,9 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener } private Animator getOpeningWindowAnimatorsForWidget(LauncherAppWidgetHostView v, - RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets, - RemoteAnimationTargetCompat[] nonAppTargets, Rect windowTargetBounds, + RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets, + RemoteAnimationTarget[] nonAppTargets, Rect windowTargetBounds, boolean appTargetsAreTranslucent) { final RectF widgetBackgroundBounds = new RectF(); final Rect appWindowCrop = new Rect(); @@ -913,7 +913,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener RemoteAnimationTargets openingTargets = new RemoteAnimationTargets(appTargets, wallpaperTargets, nonAppTargets, MODE_OPENING); - RemoteAnimationTargetCompat openingTarget = openingTargets.getFirstAppTarget(); + RemoteAnimationTarget openingTarget = openingTargets.getFirstAppTarget(); int fallbackBackgroundColor = 0; if (openingTarget != null && supportsSSplashScreen()) { fallbackBackgroundColor = mTaskStartParams.containsKey(openingTarget.taskId) @@ -937,7 +937,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener SurfaceTransactionApplier surfaceApplier = new SurfaceTransactionApplier(floatingView); openingTargets.addReleaseCheck(surfaceApplier); - RemoteAnimationTargetCompat navBarTarget = openingTargets.getNavBarRemoteAnimationTarget(); + RemoteAnimationTarget navBarTarget = openingTargets.getNavBarRemoteAnimationTarget(); AnimatorSet animatorSet = new AnimatorSet(); ValueAnimator appAnimator = ValueAnimator.ofFloat(0, 1); @@ -1004,7 +1004,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener SurfaceTransaction transaction = new SurfaceTransaction(); float floatingViewAlpha = appTargetsAreTranslucent ? 1 - mPreviewAlpha.value : 1; for (int i = appTargets.length - 1; i >= 0; i--) { - RemoteAnimationTargetCompat target = appTargets[i]; + RemoteAnimationTarget target = appTargets[i]; SurfaceProperties builder = transaction.forSurface(target.leash); if (target.mode == MODE_OPENING) { floatingView.update(widgetBackgroundBounds, floatingViewAlpha, @@ -1181,8 +1181,8 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener } } - private boolean launcherIsATargetWithMode(RemoteAnimationTargetCompat[] targets, int mode) { - for (RemoteAnimationTargetCompat target : targets) { + private boolean launcherIsATargetWithMode(RemoteAnimationTarget[] targets, int mode) { + for (RemoteAnimationTarget target : targets) { if (target.mode == mode && target.taskInfo != null // Compare component name instead of task-id because transitions will promote // the target up to the root task while getTaskId returns the leaf. @@ -1194,9 +1194,9 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener return false; } - private boolean hasMultipleTargetsWithMode(RemoteAnimationTargetCompat[] targets, int mode) { + private boolean hasMultipleTargetsWithMode(RemoteAnimationTarget[] targets, int mode) { int numTargets = 0; - for (RemoteAnimationTargetCompat target : targets) { + for (RemoteAnimationTarget target : targets) { if (target.mode == mode) { numTargets++; } @@ -1218,8 +1218,8 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener /** * Animator that controls the transformations of the windows when unlocking the device. */ - private Animator getUnlockWindowAnimator(RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets) { + private Animator getUnlockWindowAnimator(RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets) { SurfaceTransactionApplier surfaceApplier = new SurfaceTransactionApplier(mDragLayer); ValueAnimator unlockAnimator = ValueAnimator.ofFloat(0, 1); unlockAnimator.setDuration(CLOSING_TRANSITION_DURATION_MS); @@ -1230,7 +1230,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener public void onAnimationStart(Animator animation) { SurfaceTransaction transaction = new SurfaceTransaction(); for (int i = appTargets.length - 1; i >= 0; i--) { - RemoteAnimationTargetCompat target = appTargets[i]; + RemoteAnimationTarget target = appTargets[i]; transaction.forSurface(target.leash) .setAlpha(1f) .setWindowCrop(target.screenSpaceBounds) @@ -1242,9 +1242,9 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener return unlockAnimator; } - private static int getRotationChange(RemoteAnimationTargetCompat[] appTargets) { + private static int getRotationChange(RemoteAnimationTarget[] appTargets) { int rotationChange = 0; - for (RemoteAnimationTargetCompat target : appTargets) { + for (RemoteAnimationTarget target : appTargets) { if (Math.abs(target.rotationChange) > Math.abs(rotationChange)) { rotationChange = target.rotationChange; } @@ -1255,8 +1255,8 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener /** * Returns view on launcher that corresponds to the closing app in the list of app targets */ - private @Nullable View findLauncherView(RemoteAnimationTargetCompat[] appTargets) { - for (RemoteAnimationTargetCompat appTarget : appTargets) { + private @Nullable View findLauncherView(RemoteAnimationTarget[] appTargets) { + for (RemoteAnimationTarget appTarget : appTargets) { if (appTarget.mode == MODE_CLOSING) { View launcherView = findLauncherView(appTarget); if (launcherView != null) { @@ -1270,7 +1270,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener /** * Returns view on launcher that corresponds to the {@param runningTaskTarget}. */ - private @Nullable View findLauncherView(RemoteAnimationTargetCompat runningTaskTarget) { + private @Nullable View findLauncherView(RemoteAnimationTarget runningTaskTarget) { if (runningTaskTarget == null || runningTaskTarget.taskInfo == null) { return null; } @@ -1331,15 +1331,15 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener * Closing animator that animates the window into its final location on the workspace. */ private RectFSpringAnim getClosingWindowAnimators(AnimatorSet animation, - RemoteAnimationTargetCompat[] targets, View launcherView, PointF velocityPxPerS, + RemoteAnimationTarget[] targets, View launcherView, PointF velocityPxPerS, RectF closingWindowStartRect, float startWindowCornerRadius) { FloatingIconView floatingIconView = null; FloatingWidgetView floatingWidget = null; RectF targetRect = new RectF(); - RemoteAnimationTargetCompat runningTaskTarget = null; + RemoteAnimationTarget runningTaskTarget = null; boolean isTransluscent = false; - for (RemoteAnimationTargetCompat target : targets) { + for (RemoteAnimationTarget target : targets) { if (target.mode == MODE_CLOSING) { runningTaskTarget = target; isTransluscent = runningTaskTarget.isTranslucent; @@ -1433,7 +1433,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener /** * Closing window animator that moves the window down and offscreen. */ - private Animator getFallbackClosingWindowAnimators(RemoteAnimationTargetCompat[] appTargets) { + private Animator getFallbackClosingWindowAnimators(RemoteAnimationTarget[] appTargets) { final int rotationChange = getRotationChange(appTargets); SurfaceTransactionApplier surfaceApplier = new SurfaceTransactionApplier(mDragLayer); Matrix matrix = new Matrix(); @@ -1456,7 +1456,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener public void onUpdate(float percent, boolean initOnly) { SurfaceTransaction transaction = new SurfaceTransaction(); for (int i = appTargets.length - 1; i >= 0; i--) { - RemoteAnimationTargetCompat target = appTargets[i]; + RemoteAnimationTarget target = appTargets[i]; SurfaceProperties builder = transaction.forSurface(target.leash); if (target.localBounds != null) { @@ -1555,8 +1555,8 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener * the transition. */ public Pair createWallpaperOpenAnimations( - RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets, + RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets, boolean fromUnlock, RectF startRect, float startWindowCornerRadius) { @@ -1665,9 +1665,9 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener @Override public void onCreateAnimation(int transit, - RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets, - RemoteAnimationTargetCompat[] nonAppTargets, + RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets, + RemoteAnimationTarget[] nonAppTargets, LauncherAnimationRunner.AnimationResult result) { if (mLauncher.isDestroyed()) { AnimatorSet anim = new AnimatorSet(); @@ -1706,9 +1706,9 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener @Override public void onCreateAnimation(int transit, - RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets, - RemoteAnimationTargetCompat[] nonAppTargets, + RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets, + RemoteAnimationTarget[] nonAppTargets, LauncherAnimationRunner.AnimationResult result) { AnimatorSet anim = new AnimatorSet(); boolean launcherClosing = @@ -1835,7 +1835,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener * RectFSpringAnim update listener to be used for app to home animation. */ private class SpringAnimRunner implements RectFSpringAnim.OnUpdateListener { - private final RemoteAnimationTargetCompat[] mAppTargets; + private final RemoteAnimationTarget[] mAppTargets; private final Matrix mMatrix = new Matrix(); private final Point mTmpPos = new Point(); private final Rect mCurrentRect = new Rect(); @@ -1846,7 +1846,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener private final Rect mTmpRect = new Rect(); - SpringAnimRunner(RemoteAnimationTargetCompat[] appTargets, RectF targetRect, + SpringAnimRunner(RemoteAnimationTarget[] appTargets, RectF targetRect, Rect windowTargetBounds, float startWindowCornerRadius) { mAppTargets = appTargets; mStartRadius = startWindowCornerRadius; @@ -1863,7 +1863,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener public void onUpdate(RectF currentRectF, float progress) { SurfaceTransaction transaction = new SurfaceTransaction(); for (int i = mAppTargets.length - 1; i >= 0; i--) { - RemoteAnimationTargetCompat target = mAppTargets[i]; + RemoteAnimationTarget target = mAppTargets[i]; SurfaceProperties builder = transaction.forSurface(target.leash); if (target.localBounds != null) { diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 3203f44ce2..c2c7f6f6b7 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -65,6 +65,7 @@ import android.os.IBinder; import android.os.SystemProperties; import android.view.Display; import android.view.HapticFeedbackConstants; +import android.view.RemoteAnimationTarget; import android.view.View; import android.view.WindowManagerGlobal; import android.window.SplashScreen; @@ -139,7 +140,6 @@ import com.android.quickstep.views.OverviewActionsView; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; import com.android.systemui.shared.system.ActivityManagerWrapper; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import com.android.systemui.unfold.UnfoldSharedComponent; import com.android.systemui.unfold.UnfoldTransitionFactory; import com.android.systemui.unfold.UnfoldTransitionProgressProvider; @@ -761,8 +761,8 @@ public class QuickstepLauncher extends Launcher { QuickstepTransitionManager appTransitionManager = getAppTransitionManager(); appTransitionManager.setRemoteAnimationProvider(new RemoteAnimationProvider() { @Override - public AnimatorSet createWindowAnimation(RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets) { + public AnimatorSet createWindowAnimation(RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets) { // On the first call clear the reference. signal.cancel(); diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index d728b7539b..f5dc03af9e 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -15,6 +15,7 @@ */ package com.android.quickstep; +import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME; import static android.view.Surface.ROTATION_0; import static android.view.Surface.ROTATION_270; import static android.view.Surface.ROTATION_90; @@ -52,7 +53,6 @@ import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent import static com.android.quickstep.util.VibratorWrapper.OVERVIEW_HAPTIC; import static com.android.quickstep.views.RecentsView.UPDATE_SYSUI_FLAGS_THRESHOLD; import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS; -import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -73,6 +73,7 @@ import android.os.IBinder; import android.os.SystemClock; import android.util.Log; import android.view.MotionEvent; +import android.view.RemoteAnimationTarget; import android.view.View; import android.view.View.OnApplyWindowInsetsListener; import android.view.ViewGroup; @@ -128,7 +129,6 @@ 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.InteractionJankMonitorWrapper; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import com.android.systemui.shared.system.TaskStackChangeListener; import com.android.systemui.shared.system.TaskStackChangeListeners; import com.android.wm.shell.common.TransactionPool; @@ -683,7 +683,7 @@ public abstract class AbsSwipeUpHandler, if (!mDeviceState.isFullyGesturalNavMode() || mRecentsView == null) { return; } - RemoteAnimationTargetCompat runningTaskTarget = mRecentsAnimationTargets != null + RemoteAnimationTarget runningTaskTarget = mRecentsAnimationTargets != null ? mRecentsAnimationTargets.findTask(mGestureState.getRunningTaskId()) : null; final boolean recentsAttachedToAppWindow; @@ -867,7 +867,7 @@ public abstract class AbsSwipeUpHandler, // Only initialize the device profile, if it has not been initialized before, as in some // configurations targets.homeContentInsets may not be correct. if (mActivity == null) { - RemoteAnimationTargetCompat primaryTaskTarget = targets.apps[0]; + RemoteAnimationTarget primaryTaskTarget = targets.apps[0]; // orientation state is independent of which remote target handle we use since both // should be pointing to the same one. Just choose index 0 for now since that works for // both split and non-split @@ -1076,7 +1076,7 @@ public abstract class AbsSwipeUpHandler, } /** @return Whether this was the task we were waiting to appear, and thus handled it. */ - protected boolean handleTaskAppeared(RemoteAnimationTargetCompat[] appearedTaskTarget) { + protected boolean handleTaskAppeared(RemoteAnimationTarget[] appearedTaskTarget) { if (mStateCallback.hasStates(STATE_HANDLER_INVALIDATED)) { return false; } @@ -1315,7 +1315,7 @@ public abstract class AbsSwipeUpHandler, protected abstract HomeAnimationFactory createHomeAnimationFactory( ArrayList launchCookies, long duration, boolean isTargetTranslucent, - boolean appCanEnterPip, RemoteAnimationTargetCompat runningTaskTarget); + boolean appCanEnterPip, RemoteAnimationTarget runningTaskTarget); private final TaskStackChangeListener mActivityRestartListener = new TaskStackChangeListener() { @Override @@ -1362,7 +1362,7 @@ public abstract class AbsSwipeUpHandler, if (mGestureState.getEndTarget() == HOME) { getOrientationHandler().adjustFloatingIconStartVelocity(velocityPxPerMs); - final RemoteAnimationTargetCompat runningTaskTarget = mRecentsAnimationTargets != null + final RemoteAnimationTarget runningTaskTarget = mRecentsAnimationTargets != null ? mRecentsAnimationTargets.findTask(mGestureState.getRunningTaskId()) : null; final ArrayList cookies = runningTaskTarget != null @@ -1472,7 +1472,7 @@ public abstract class AbsSwipeUpHandler, } } - private int calculateWindowRotation(RemoteAnimationTargetCompat runningTaskTarget, + private int calculateWindowRotation(RemoteAnimationTarget runningTaskTarget, RecentsOrientedState orientationState) { if (runningTaskTarget.rotationChange != 0 && TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) { @@ -1485,7 +1485,7 @@ public abstract class AbsSwipeUpHandler, @Nullable private SwipePipToHomeAnimator createWindowAnimationToPip(HomeAnimationFactory homeAnimFactory, - RemoteAnimationTargetCompat runningTaskTarget, float startProgress) { + RemoteAnimationTarget runningTaskTarget, float startProgress) { // Directly animate the app to PiP (picture-in-picture) mode final ActivityManager.RunningTaskInfo taskInfo = runningTaskTarget.taskInfo; final RecentsOrientedState orientationState = mRemoteTargetHandles[0].getTaskViewSimulator() @@ -1959,9 +1959,9 @@ public abstract class AbsSwipeUpHandler, reset(); } - private static boolean isNotInRecents(RemoteAnimationTargetCompat app) { + private static boolean isNotInRecents(RemoteAnimationTarget app) { return app.isNotInRecents - || app.activityType == ACTIVITY_TYPE_HOME; + || app.windowConfiguration.getActivityType() == ACTIVITY_TYPE_HOME; } /** @@ -2084,10 +2084,10 @@ public abstract class AbsSwipeUpHandler, } @Override - public void onTasksAppeared(RemoteAnimationTargetCompat[] appearedTaskTargets) { + public void onTasksAppeared(RemoteAnimationTarget[] appearedTaskTargets) { if (mRecentsAnimationController != null) { if (handleTaskAppeared(appearedTaskTargets)) { - Optional taskTargetOptional = + Optional taskTargetOptional = Arrays.stream(appearedTaskTargets) .filter(targetCompat -> targetCompat.taskId == mGestureState.getLastStartedTaskId()) @@ -2096,7 +2096,7 @@ public abstract class AbsSwipeUpHandler, finishRecentsAnimationOnTasksAppeared(); return; } - RemoteAnimationTargetCompat taskTarget = taskTargetOptional.get(); + RemoteAnimationTarget taskTarget = taskTargetOptional.get(); TaskView taskView = mRecentsView.getTaskViewByTaskId(taskTarget.taskId); if (taskView == null || !taskView.getThumbnail().shouldShowSplashView()) { finishRecentsAnimationOnTasksAppeared(); @@ -2110,7 +2110,7 @@ public abstract class AbsSwipeUpHandler, SurfaceTransactionApplier surfaceApplier = new SurfaceTransactionApplier(splashView); SurfaceTransaction transaction = new SurfaceTransaction(); - for (RemoteAnimationTargetCompat target : appearedTaskTargets) { + for (RemoteAnimationTarget target : appearedTaskTargets) { transaction.forSurface(target.leash).setAlpha(1).setLayer(-1); } surfaceApplier.scheduleApply(transaction); diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index d4320043b0..cf640b5c09 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -40,6 +40,7 @@ import android.graphics.Rect; import android.os.Build; import android.view.Gravity; import android.view.MotionEvent; +import android.view.RemoteAnimationTarget; import android.view.View; import androidx.annotation.Nullable; @@ -62,7 +63,6 @@ import com.android.quickstep.util.ActivityInitListener; import com.android.quickstep.util.AnimatorControllerWithResistance; import com.android.quickstep.views.RecentsView; import com.android.systemui.shared.recents.model.ThumbnailData; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.util.HashMap; import java.util.Optional; @@ -162,7 +162,7 @@ public abstract class BaseActivityInterface launchCookies, long duration, boolean isTargetTranslucent, boolean appCanEnterPip, - RemoteAnimationTargetCompat runningTaskTarget) { + RemoteAnimationTarget runningTaskTarget) { mAppCanEnterPip = appCanEnterPip; if (appCanEnterPip) { return new FallbackPipToHomeAnimationFactory(); @@ -154,7 +154,7 @@ public class FallbackSwipeHandler extends private void startHomeIntent( @Nullable FallbackHomeAnimationFactory gestureContractAnimationFactory, - @Nullable RemoteAnimationTargetCompat runningTaskTarget) { + @Nullable RemoteAnimationTarget runningTaskTarget) { ActivityOptions options = ActivityOptions.makeCustomAnimation(mContext, 0, 0); Intent intent = new Intent(mGestureState.getHomeIntent()); if (gestureContractAnimationFactory != null && runningTaskTarget != null) { @@ -164,7 +164,7 @@ public class FallbackSwipeHandler extends } @Override - protected boolean handleTaskAppeared(RemoteAnimationTargetCompat[] appearedTaskTarget) { + protected boolean handleTaskAppeared(RemoteAnimationTarget[] appearedTaskTarget) { if (mActiveAnimationFactory != null && mActiveAnimationFactory.handleHomeTaskAppeared(appearedTaskTarget)) { mActiveAnimationFactory = null; @@ -280,12 +280,12 @@ public class FallbackSwipeHandler extends } private void updateRecentsActivityTransformDuringHomeAnim(SurfaceProperties builder, - RemoteAnimationTargetCompat app, TransformParams params) { + RemoteAnimationTarget app, TransformParams params) { builder.setAlpha(mRecentsAlpha.value); } private void updateHomeActivityTransformDuringHomeAnim(SurfaceProperties builder, - RemoteAnimationTargetCompat app, TransformParams params) { + RemoteAnimationTarget app, TransformParams params) { setHomeScaleAndAlpha(builder, app, mVerticalShiftForScale.value, mHomeAlpha.value); } @@ -304,12 +304,12 @@ public class FallbackSwipeHandler extends } } - public boolean handleHomeTaskAppeared(RemoteAnimationTargetCompat[] appearedTaskTargets) { - RemoteAnimationTargetCompat appearedTaskTarget = appearedTaskTargets[0]; - if (appearedTaskTarget.activityType == ACTIVITY_TYPE_HOME) { + public boolean handleHomeTaskAppeared(RemoteAnimationTarget[] appearedTaskTargets) { + RemoteAnimationTarget appearedTaskTarget = appearedTaskTargets[0]; + if (appearedTaskTarget.windowConfiguration.getActivityType() == ACTIVITY_TYPE_HOME) { RemoteAnimationTargets targets = new RemoteAnimationTargets( - new RemoteAnimationTargetCompat[] {appearedTaskTarget}, - new RemoteAnimationTargetCompat[0], new RemoteAnimationTargetCompat[0], + new RemoteAnimationTarget[] {appearedTaskTarget}, + new RemoteAnimationTarget[0], new RemoteAnimationTarget[0], appearedTaskTarget.mode); mHomeAlphaParams.setTargetSet(targets); updateHomeAlpha(); diff --git a/quickstep/src/com/android/quickstep/GestureState.java b/quickstep/src/com/android/quickstep/GestureState.java index bcd96878e3..3c4ee75aae 100644 --- a/quickstep/src/com/android/quickstep/GestureState.java +++ b/quickstep/src/com/android/quickstep/GestureState.java @@ -28,6 +28,7 @@ import android.annotation.Nullable; import android.annotation.TargetApi; import android.content.Intent; import android.os.Build; +import android.view.RemoteAnimationTarget; import com.android.launcher3.statemanager.BaseState; import com.android.launcher3.statemanager.StatefulActivity; @@ -37,7 +38,6 @@ import com.android.quickstep.TopTaskTracker.CachedTaskInfo; import com.android.quickstep.util.ActiveGestureErrorDetector; import com.android.quickstep.util.ActiveGestureLog; import com.android.systemui.shared.recents.model.ThumbnailData; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.io.PrintWriter; import java.util.ArrayList; @@ -143,7 +143,7 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL private CachedTaskInfo mRunningTask; private GestureEndTarget mEndTarget; - private RemoteAnimationTargetCompat mLastAppearedTaskTarget; + private RemoteAnimationTarget mLastAppearedTaskTarget; private Set mPreviouslyAppearedTaskIds = new HashSet<>(); private int mLastStartedTaskId = -1; private RecentsAnimationController mRecentsAnimationController; @@ -272,7 +272,7 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL /** * Updates the last task that appeared during this gesture. */ - public void updateLastAppearedTaskTarget(RemoteAnimationTargetCompat lastAppearedTaskTarget) { + public void updateLastAppearedTaskTarget(RemoteAnimationTarget lastAppearedTaskTarget) { mLastAppearedTaskTarget = lastAppearedTaskTarget; if (lastAppearedTaskTarget != null) { mPreviouslyAppearedTaskIds.add(lastAppearedTaskTarget.taskId); diff --git a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java index 8522a87ba7..686c0e4fb3 100644 --- a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java +++ b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java @@ -28,6 +28,7 @@ import android.animation.AnimatorSet; import android.content.Context; import android.graphics.Rect; import android.view.MotionEvent; +import android.view.RemoteAnimationTarget; import androidx.annotation.Nullable; import androidx.annotation.UiThread; @@ -51,7 +52,6 @@ import com.android.quickstep.util.AnimatorControllerWithResistance; import com.android.quickstep.util.LayoutUtils; import com.android.quickstep.views.RecentsView; import com.android.systemui.plugins.shared.LauncherOverlayManager; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.util.function.Consumer; import java.util.function.Predicate; @@ -252,7 +252,7 @@ public final class LauncherActivityInterface extends } @Override - public Rect getOverviewWindowBounds(Rect homeBounds, RemoteAnimationTargetCompat target) { + public Rect getOverviewWindowBounds(Rect homeBounds, RemoteAnimationTarget target) { return homeBounds; } diff --git a/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java b/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java index eed934b617..21ecc5cb20 100644 --- a/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java +++ b/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java @@ -51,7 +51,6 @@ import com.android.launcher3.Utilities; import com.android.launcher3.uioverrides.QuickstepLauncher; import com.android.quickstep.util.RectFSpringAnim; import com.android.systemui.shared.system.QuickStepContract; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; /** * Controls the animation of swiping back and returning to launcher. @@ -89,7 +88,7 @@ public class LauncherBackAnimationController { private final Interpolator mCancelInterpolator; private final PointF mInitialTouchPos = new PointF(); - private RemoteAnimationTargetCompat mBackTarget; + private RemoteAnimationTarget mBackTarget; private SurfaceControl.Transaction mTransaction = new SurfaceControl.Transaction(); private boolean mSpringAnimationInProgress = false; private boolean mAnimatorSetInProgress = false; @@ -157,7 +156,7 @@ public class LauncherBackAnimationController { IRemoteAnimationFinishedCallback finishedCallback) { for (final RemoteAnimationTarget target : apps) { if (MODE_CLOSING == target.mode) { - mBackTarget = new RemoteAnimationTargetCompat(target); + mBackTarget = target; break; } } @@ -302,8 +301,8 @@ public class LauncherBackAnimationController { mBackProgress, mWindowScaleStartCornerRadius, mWindowScaleEndCornerRadius); Pair pair = mQuickstepTransitionManager.createWallpaperOpenAnimations( - new RemoteAnimationTargetCompat[]{mBackTarget}, - new RemoteAnimationTargetCompat[]{}, + new RemoteAnimationTarget[]{mBackTarget}, + new RemoteAnimationTarget[0], false /* fromUnlock */, mCurrentRect, cornerRadius); diff --git a/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java b/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java index d1533f0347..bb781c82b7 100644 --- a/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java +++ b/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java @@ -30,6 +30,7 @@ import android.graphics.RectF; import android.os.IBinder; import android.os.UserHandle; import android.util.Size; +import android.view.RemoteAnimationTarget; import android.view.View; import androidx.annotation.NonNull; @@ -49,7 +50,6 @@ import com.android.quickstep.views.FloatingWidgetView; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; import com.android.systemui.shared.system.InputConsumerController; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.util.ArrayList; @@ -70,7 +70,7 @@ public class LauncherSwipeHandlerV2 extends @Override protected HomeAnimationFactory createHomeAnimationFactory(ArrayList launchCookies, long duration, boolean isTargetTranslucent, boolean appCanEnterPip, - RemoteAnimationTargetCompat runningTaskTarget) { + RemoteAnimationTarget runningTaskTarget) { if (mActivity == null) { mStateCallback.addChangeListener(STATE_LAUNCHER_PRESENT | STATE_HANDLER_INVALIDATED, isPresent -> mRecentsView.startHome()); @@ -144,7 +144,7 @@ public class LauncherSwipeHandlerV2 extends private HomeAnimationFactory createWidgetHomeAnimationFactory( LauncherAppWidgetHostView hostView, boolean isTargetTranslucent, - RemoteAnimationTargetCompat runningTaskTarget) { + RemoteAnimationTarget runningTaskTarget) { final float floatingWidgetAlpha = isTargetTranslucent ? 0 : 1; RectF backgroundLocation = new RectF(); Rect crop = new Rect(); diff --git a/quickstep/src/com/android/quickstep/RecentsActivity.java b/quickstep/src/com/android/quickstep/RecentsActivity.java index 4f5e216336..97ce30fda7 100644 --- a/quickstep/src/com/android/quickstep/RecentsActivity.java +++ b/quickstep/src/com/android/quickstep/RecentsActivity.java @@ -15,6 +15,9 @@ */ package com.android.quickstep; +import static android.view.RemoteAnimationTarget.MODE_CLOSING; +import static android.view.RemoteAnimationTarget.MODE_OPENING; + import static com.android.launcher3.QuickstepTransitionManager.RECENTS_LAUNCH_DURATION; import static com.android.launcher3.QuickstepTransitionManager.STATUS_BAR_TRANSITION_DURATION; import static com.android.launcher3.QuickstepTransitionManager.STATUS_BAR_TRANSITION_PRE_DELAY; @@ -23,8 +26,6 @@ import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_STATE_O import static com.android.quickstep.OverviewComponentObserver.startHomeIntentSafely; import static com.android.quickstep.TaskUtils.taskIsATargetWithMode; import static com.android.quickstep.TaskViewUtils.createRecentsWindowAnimator; -import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING; -import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -36,6 +37,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.view.Display; +import android.view.RemoteAnimationTarget; import android.view.SurfaceControl.Transaction; import android.view.View; import android.window.SplashScreen; @@ -78,7 +80,6 @@ import com.android.quickstep.views.OverviewActionsView; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; import com.android.systemui.shared.system.RemoteAnimationAdapterCompat; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.io.FileDescriptor; import java.io.PrintWriter; @@ -238,9 +239,9 @@ public final class RecentsActivity extends StatefulActivity { mActivityLaunchAnimationRunner = new RemoteAnimationFactory() { @Override - public void onCreateAnimation(int transit, RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets, - RemoteAnimationTargetCompat[] nonAppTargets, AnimationResult result) { + public void onCreateAnimation(int transit, RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets, + RemoteAnimationTarget[] nonAppTargets, AnimationResult result) { mHandler.removeCallbacks(mAnimationStartTimeoutRunnable); AnimatorSet anim = composeRecentsLaunchAnimator(taskView, appTargets, wallpaperTargets, nonAppTargets); @@ -279,9 +280,9 @@ public final class RecentsActivity extends StatefulActivity { * Composes the animations for a launch from the recents list if possible. */ private AnimatorSet composeRecentsLaunchAnimator(TaskView taskView, - RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets, - RemoteAnimationTargetCompat[] nonAppTargets) { + RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets, + RemoteAnimationTarget[] nonAppTargets) { AnimatorSet target = new AnimatorSet(); boolean activityClosing = taskIsATargetWithMode(appTargets, getTaskId(), MODE_CLOSING); PendingAnimation pa = new PendingAnimation(RECENTS_LAUNCH_DURATION); @@ -412,16 +413,16 @@ public final class RecentsActivity extends StatefulActivity { private final RemoteAnimationFactory mAnimationToHomeFactory = new RemoteAnimationFactory() { @Override - public void onCreateAnimation(int transit, RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets, - RemoteAnimationTargetCompat[] nonAppTargets, AnimationResult result) { + public void onCreateAnimation(int transit, RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets, + RemoteAnimationTarget[] nonAppTargets, AnimationResult result) { AnimatorPlaybackController controller = getStateManager() .createAnimationToNewWorkspace(RecentsState.BG_LAUNCHER, HOME_APPEAR_DURATION); controller.dispatchOnStart(); RemoteAnimationTargets targets = new RemoteAnimationTargets( appTargets, wallpaperTargets, nonAppTargets, MODE_OPENING); - for (RemoteAnimationTargetCompat app : targets.apps) { + for (RemoteAnimationTarget app : targets.apps) { new Transaction().setAlpha(app.leash, 1).apply(); } AnimatorSet anim = new AnimatorSet(); diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java index b233521ff2..2451ad813b 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java @@ -33,9 +33,7 @@ import com.android.quickstep.util.ActiveGestureErrorDetector; import com.android.quickstep.util.ActiveGestureLog; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.RecentsAnimationControllerCompat; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; -import java.util.Arrays; import java.util.HashMap; import java.util.Set; @@ -88,17 +86,17 @@ public class RecentsAnimationCallbacks implements @BinderThread @Deprecated public final void onAnimationStart(RecentsAnimationControllerCompat controller, - RemoteAnimationTargetCompat[] appTargets, Rect homeContentInsets, + RemoteAnimationTarget[] appTargets, Rect homeContentInsets, Rect minimizedHomeBounds) { - onAnimationStart(controller, appTargets, new RemoteAnimationTargetCompat[0], + onAnimationStart(controller, appTargets, new RemoteAnimationTarget[0], homeContentInsets, minimizedHomeBounds); } // Called only in R+ platform @BinderThread public final void onAnimationStart(RecentsAnimationControllerCompat animationController, - RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets, + RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets, Rect homeContentInsets, Rect minimizedHomeBounds) { mController = new RecentsAnimationController(animationController, mAllowMinimizeSplitScreen, this::onAnimationFinished); @@ -107,12 +105,13 @@ public class RecentsAnimationCallbacks implements Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), mController::finishAnimationToApp); } else { - final RemoteAnimationTarget[] nonAppTargets = mSystemUiProxy.onGoingToRecentsLegacy( - Arrays.stream(appTargets).map(RemoteAnimationTargetCompat::unwrap) - .toArray(RemoteAnimationTarget[]::new)); + RemoteAnimationTarget[] nonAppTargets = + mSystemUiProxy.onGoingToRecentsLegacy(appTargets); + if (nonAppTargets == null) { + nonAppTargets = new RemoteAnimationTarget[0]; + } final RecentsAnimationTargets targets = new RecentsAnimationTargets(appTargets, - wallpaperTargets, RemoteAnimationTargetCompat.wrap(nonAppTargets), - homeContentInsets, minimizedHomeBounds); + wallpaperTargets, nonAppTargets, homeContentInsets, minimizedHomeBounds); Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> { ActiveGestureLog.INSTANCE.addLog( @@ -141,7 +140,7 @@ public class RecentsAnimationCallbacks implements @BinderThread @Override - public void onTasksAppeared(RemoteAnimationTargetCompat[] apps) { + public void onTasksAppeared(RemoteAnimationTarget[] apps) { Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> { ActiveGestureLog.INSTANCE.addLog("onTasksAppeared", ActiveGestureErrorDetector.GestureEvent.TASK_APPEARED); @@ -197,7 +196,7 @@ public class RecentsAnimationCallbacks implements /** * Callback made when a task started from the recents is ready for an app transition. */ - default void onTasksAppeared(@NonNull RemoteAnimationTargetCompat[] appearedTaskTarget) {} + default void onTasksAppeared(@NonNull RemoteAnimationTarget[] appearedTaskTarget) {} /** * @return whether this will call onFinished or not (onFinished should only be called once). diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationController.java b/quickstep/src/com/android/quickstep/RecentsAnimationController.java index 542c0d4b21..81e3782142 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationController.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationController.java @@ -23,6 +23,7 @@ import android.content.Context; import android.os.RemoteException; import android.util.Log; import android.view.IRecentsAnimationController; +import android.view.RemoteAnimationTarget; import android.view.SurfaceControl; import android.view.WindowManagerGlobal; import android.window.PictureInPictureSurfaceTransaction; @@ -37,7 +38,6 @@ import com.android.quickstep.util.ActiveGestureLog; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.InteractionJankMonitorWrapper; import com.android.systemui.shared.system.RecentsAnimationControllerCompat; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.util.function.Consumer; @@ -114,7 +114,7 @@ public class RecentsAnimationController { * {@link RecentsAnimationCallbacks#onTasksAppeared}}. */ @UiThread - public void removeTaskTarget(@NonNull RemoteAnimationTargetCompat target) { + public void removeTaskTarget(@NonNull RemoteAnimationTarget target) { UI_HELPER_EXECUTOR.execute(() -> mController.removeTask(target.taskId)); } diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationTargets.java b/quickstep/src/com/android/quickstep/RecentsAnimationTargets.java index b6d9016727..388e1256d8 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationTargets.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationTargets.java @@ -15,11 +15,10 @@ */ package com.android.quickstep; -import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING; +import static android.view.RemoteAnimationTarget.MODE_CLOSING; import android.graphics.Rect; - -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; +import android.view.RemoteAnimationTarget; /** * Extension of {@link RemoteAnimationTargets} with additional information about swipe @@ -30,8 +29,8 @@ public class RecentsAnimationTargets extends RemoteAnimationTargets { public final Rect homeContentInsets; public final Rect minimizedHomeBounds; - public RecentsAnimationTargets(RemoteAnimationTargetCompat[] apps, - RemoteAnimationTargetCompat[] wallpapers, RemoteAnimationTargetCompat[] nonApps, + public RecentsAnimationTargets(RemoteAnimationTarget[] apps, + RemoteAnimationTarget[] wallpapers, RemoteAnimationTarget[] nonApps, Rect homeContentInsets, Rect minimizedHomeBounds) { super(apps, wallpapers, nonApps, MODE_CLOSING); this.homeContentInsets = homeContentInsets; diff --git a/quickstep/src/com/android/quickstep/RemoteAnimationTargets.java b/quickstep/src/com/android/quickstep/RemoteAnimationTargets.java index 1bd808d13d..80aaad0dd9 100644 --- a/quickstep/src/com/android/quickstep/RemoteAnimationTargets.java +++ b/quickstep/src/com/android/quickstep/RemoteAnimationTargets.java @@ -15,9 +15,11 @@ */ package com.android.quickstep; +import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME; +import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS; import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; +import android.view.RemoteAnimationTarget; import java.util.ArrayList; import java.util.concurrent.CopyOnWriteArrayList; @@ -29,41 +31,40 @@ public class RemoteAnimationTargets { private final CopyOnWriteArrayList mReleaseChecks = new CopyOnWriteArrayList<>(); - public final RemoteAnimationTargetCompat[] unfilteredApps; - public final RemoteAnimationTargetCompat[] apps; - public final RemoteAnimationTargetCompat[] wallpapers; - public final RemoteAnimationTargetCompat[] nonApps; + public final RemoteAnimationTarget[] unfilteredApps; + public final RemoteAnimationTarget[] apps; + public final RemoteAnimationTarget[] wallpapers; + public final RemoteAnimationTarget[] nonApps; public final int targetMode; public final boolean hasRecents; private boolean mReleased = false; - public RemoteAnimationTargets(RemoteAnimationTargetCompat[] apps, - RemoteAnimationTargetCompat[] wallpapers, RemoteAnimationTargetCompat[] nonApps, + public RemoteAnimationTargets(RemoteAnimationTarget[] apps, + RemoteAnimationTarget[] wallpapers, RemoteAnimationTarget[] nonApps, int targetMode) { - ArrayList filteredApps = new ArrayList<>(); + ArrayList filteredApps = new ArrayList<>(); boolean hasRecents = false; if (apps != null) { - for (RemoteAnimationTargetCompat target : apps) { + for (RemoteAnimationTarget target : apps) { if (target.mode == targetMode) { filteredApps.add(target); } - hasRecents |= target.activityType == - RemoteAnimationTargetCompat.ACTIVITY_TYPE_RECENTS; + hasRecents |= target.windowConfiguration.getActivityType() == ACTIVITY_TYPE_RECENTS; } } this.unfilteredApps = apps; - this.apps = filteredApps.toArray(new RemoteAnimationTargetCompat[filteredApps.size()]); + this.apps = filteredApps.toArray(new RemoteAnimationTarget[filteredApps.size()]); this.wallpapers = wallpapers; this.targetMode = targetMode; this.hasRecents = hasRecents; this.nonApps = nonApps; } - public RemoteAnimationTargetCompat findTask(int taskId) { - for (RemoteAnimationTargetCompat target : apps) { + public RemoteAnimationTarget findTask(int taskId) { + for (RemoteAnimationTarget target : apps) { if (target.taskId == taskId) { return target; } @@ -74,12 +75,12 @@ public class RemoteAnimationTargets { /** * Gets the navigation bar remote animation target if exists. */ - public RemoteAnimationTargetCompat getNavBarRemoteAnimationTarget() { + public RemoteAnimationTarget getNavBarRemoteAnimationTarget() { return getNonAppTargetOfType(TYPE_NAVIGATION_BAR); } - public RemoteAnimationTargetCompat getNonAppTargetOfType(int type) { - for (RemoteAnimationTargetCompat target : nonApps) { + public RemoteAnimationTarget getNonAppTargetOfType(int type) { + for (RemoteAnimationTarget target : nonApps) { if (target.windowType == type) { return target; } @@ -88,19 +89,19 @@ public class RemoteAnimationTargets { } /** Returns the first opening app target. */ - public RemoteAnimationTargetCompat getFirstAppTarget() { + public RemoteAnimationTarget getFirstAppTarget() { return apps.length > 0 ? apps[0] : null; } /** Returns the task id of the first opening app target, or -1 if none is found. */ public int getFirstAppTargetTaskId() { - RemoteAnimationTargetCompat target = getFirstAppTarget(); + RemoteAnimationTarget target = getFirstAppTarget(); return target == null ? -1 : target.taskId; } public boolean isAnimatingHome() { - for (RemoteAnimationTargetCompat target : unfilteredApps) { - if (target.activityType == RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME) { + for (RemoteAnimationTarget target : unfilteredApps) { + if (target.windowConfiguration.getActivityType() == ACTIVITY_TYPE_HOME) { return true; } } @@ -123,15 +124,19 @@ public class RemoteAnimationTargets { } mReleaseChecks.clear(); mReleased = true; + release(unfilteredApps); + release(wallpapers); + release(nonApps); + } - for (RemoteAnimationTargetCompat target : unfilteredApps) { - target.release(); - } - for (RemoteAnimationTargetCompat target : wallpapers) { - target.release(); - } - for (RemoteAnimationTargetCompat target : nonApps) { - target.release(); + private static void release(RemoteAnimationTarget[] targets) { + for (RemoteAnimationTarget target : targets) { + if (target.leash != null) { + target.leash.release(); + } + if (target.startLeash != null) { + target.startLeash.release(); + } } } diff --git a/quickstep/src/com/android/quickstep/RemoteTargetGluer.java b/quickstep/src/com/android/quickstep/RemoteTargetGluer.java index 7183c49ca2..4c41bef26a 100644 --- a/quickstep/src/com/android/quickstep/RemoteTargetGluer.java +++ b/quickstep/src/com/android/quickstep/RemoteTargetGluer.java @@ -17,6 +17,8 @@ package com.android.quickstep; import android.content.Context; +import android.graphics.Rect; +import android.view.RemoteAnimationTarget; import androidx.annotation.Nullable; @@ -24,7 +26,6 @@ import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds; import com.android.quickstep.util.AnimatorControllerWithResistance; import com.android.quickstep.util.TaskViewSimulator; import com.android.quickstep.util.TransformParams; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.util.ArrayList; @@ -75,7 +76,7 @@ public class RemoteTargetGluer { */ public RemoteTargetHandle[] assignTargets(RemoteAnimationTargets targets) { for (int i = 0; i < mRemoteTargetHandles.length; i++) { - RemoteAnimationTargetCompat primaryTaskTarget = targets.apps[i]; + RemoteAnimationTarget primaryTaskTarget = targets.apps[i]; mRemoteTargetHandles[i].mTransformParams.setTargetSet( createRemoteAnimationTargetsForTarget(targets, null)); mRemoteTargetHandles[i].mTaskViewSimulator.setPreview(primaryTaskTarget, null); @@ -100,8 +101,8 @@ public class RemoteTargetGluer { */ public RemoteTargetHandle[] assignTargetsForSplitScreen(RemoteAnimationTargets targets, int[] splitIds) { - RemoteAnimationTargetCompat topLeftTarget; // only one set if single/fullscreen task - RemoteAnimationTargetCompat bottomRightTarget; + RemoteAnimationTarget topLeftTarget; // only one set if single/fullscreen task + RemoteAnimationTarget bottomRightTarget; if (mRemoteTargetHandles.length == 1) { // If we're not in split screen, the splitIds count doesn't really matter since we // should always hit this case. @@ -119,8 +120,8 @@ public class RemoteTargetGluer { // remoteTargetHandle[0] denotes topLeft task, so we pass in the bottomRight to exclude, // vice versa mSplitBounds = new SplitBounds( - topLeftTarget.startScreenSpaceBounds, - bottomRightTarget.startScreenSpaceBounds, splitIds[0], splitIds[1]); + getStartBounds(topLeftTarget), + getStartBounds(bottomRightTarget), splitIds[0], splitIds[1]); mRemoteTargetHandles[0].mTransformParams.setTargetSet( createRemoteAnimationTargetsForTarget(targets, bottomRightTarget)); mRemoteTargetHandles[0].mTaskViewSimulator.setPreview(topLeftTarget, @@ -134,6 +135,10 @@ public class RemoteTargetGluer { return mRemoteTargetHandles; } + private Rect getStartBounds(RemoteAnimationTarget target) { + return target.startBounds == null ? target.screenSpaceBounds : target.startBounds; + } + /** * Ensures that we aren't excluding ancillary targets such as home/recents * @@ -144,11 +149,10 @@ public class RemoteTargetGluer { */ private RemoteAnimationTargets createRemoteAnimationTargetsForTarget( RemoteAnimationTargets targets, - RemoteAnimationTargetCompat targetToExclude) { - ArrayList targetsWithoutExcluded = - new ArrayList(); + RemoteAnimationTarget targetToExclude) { + ArrayList targetsWithoutExcluded = new ArrayList<>(); - for (RemoteAnimationTargetCompat targetCompat : targets.unfilteredApps) { + for (RemoteAnimationTarget targetCompat : targets.unfilteredApps) { if (targetCompat == targetToExclude) { continue; } @@ -162,9 +166,8 @@ public class RemoteTargetGluer { targetsWithoutExcluded.add(targetCompat); } - final RemoteAnimationTargetCompat[] filteredApps = - targetsWithoutExcluded.toArray( - new RemoteAnimationTargetCompat[targetsWithoutExcluded.size()]); + final RemoteAnimationTarget[] filteredApps = targetsWithoutExcluded.toArray( + new RemoteAnimationTarget[targetsWithoutExcluded.size()]); return new RemoteAnimationTargets( filteredApps, targets.wallpapers, targets.nonApps, targets.targetMode); } diff --git a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java index 71e8a774f7..f591a1cff6 100644 --- a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java +++ b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java @@ -24,6 +24,7 @@ import android.graphics.Matrix; import android.graphics.Matrix.ScaleToFit; import android.graphics.Rect; import android.graphics.RectF; +import android.view.RemoteAnimationTarget; import androidx.annotation.NonNull; import androidx.annotation.UiThread; @@ -41,7 +42,6 @@ import com.android.quickstep.util.SurfaceTransaction.SurfaceProperties; import com.android.quickstep.util.TaskViewSimulator; import com.android.quickstep.util.TransformParams; import com.android.quickstep.util.TransformParams.BuilderProxy; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.util.Arrays; import java.util.function.Consumer; @@ -335,7 +335,7 @@ public abstract class SwipeUpAnimationLogic implements } @Override - public void onBuildTargetParams(SurfaceProperties builder, RemoteAnimationTargetCompat app, + public void onBuildTargetParams(SurfaceProperties builder, RemoteAnimationTarget app, TransformParams params) { builder.setMatrix(mMatrix) .setWindowCrop(mCropRect) diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index 87d2109cc0..fd97ce9930 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -675,6 +675,7 @@ public class SystemUiProxy implements ISystemUiProxy { * * @return RemoteAnimationTargets of windows that need to animate but only exist in shell. */ + @Nullable public RemoteAnimationTarget[] onGoingToRecentsLegacy(RemoteAnimationTarget[] apps) { if (mSplitScreen != null) { try { @@ -686,6 +687,7 @@ public class SystemUiProxy implements ISystemUiProxy { return null; } + @Nullable public RemoteAnimationTarget[] onStartingSplitLegacy(RemoteAnimationTarget[] apps) { if (mSplitScreen != null) { try { diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java index 7f1656500a..30d445fc31 100644 --- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java +++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java @@ -15,11 +15,12 @@ */ package com.android.quickstep; +import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME; + import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import static com.android.quickstep.GestureState.STATE_RECENTS_ANIMATION_INITIALIZED; import static com.android.quickstep.GestureState.STATE_RECENTS_ANIMATION_STARTED; -import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME; import android.app.ActivityManager; import android.app.ActivityOptions; @@ -38,12 +39,10 @@ import com.android.quickstep.TopTaskTracker.CachedTaskInfo; import com.android.quickstep.views.RecentsView; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.ActivityManagerWrapper; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import com.android.systemui.shared.system.RemoteTransitionCompat; import com.android.systemui.shared.system.TaskStackChangeListener; import com.android.systemui.shared.system.TaskStackChangeListeners; -import java.util.Arrays; import java.util.HashMap; public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAnimationListener { @@ -57,7 +56,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn private RecentsAnimationTargets mTargets; // Temporary until we can hook into gesture state events private GestureState mLastGestureState; - private RemoteAnimationTargetCompat mLastAppearedTaskTarget; + private RemoteAnimationTarget mLastAppearedTaskTarget; private Runnable mLiveTileCleanUpHandler; private Context mCtx; @@ -151,12 +150,12 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn } @Override - public void onTasksAppeared(RemoteAnimationTargetCompat[] appearedTaskTargets) { - RemoteAnimationTargetCompat appearedTaskTarget = appearedTaskTargets[0]; + public void onTasksAppeared(RemoteAnimationTarget[] appearedTaskTargets) { + RemoteAnimationTarget appearedTaskTarget = appearedTaskTargets[0]; BaseActivityInterface activityInterface = mLastGestureState.getActivityInterface(); - for (RemoteAnimationTargetCompat compat : appearedTaskTargets) { - if (compat.activityType == ACTIVITY_TYPE_HOME + for (RemoteAnimationTarget compat : appearedTaskTargets) { + if (compat.windowConfiguration.getActivityType() == ACTIVITY_TYPE_HOME && activityInterface.getCreatedActivity() instanceof RecentsActivity) { // When receive opening home activity while recents is running, enter home // and dismiss recents. @@ -165,11 +164,11 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn } } - RemoteAnimationTarget[] nonAppTargets = SystemUiProxy.INSTANCE.getNoCreate() - .onStartingSplitLegacy(Arrays.stream(appearedTaskTargets) - .map(RemoteAnimationTargetCompat::unwrap) - .toArray(RemoteAnimationTarget[]::new)); - + RemoteAnimationTarget[] nonAppTargets = SystemUiProxy.INSTANCE.get(mCtx) + .onStartingSplitLegacy(appearedTaskTargets); + if (nonAppTargets == null) { + nonAppTargets = new RemoteAnimationTarget[0]; + } if (activityInterface.isInLiveTileMode() && activityInterface.getCreatedActivity() != null) { RecentsView recentsView = @@ -177,13 +176,13 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn if (recentsView != null) { recentsView.launchSideTaskInLiveTileMode(appearedTaskTarget.taskId, appearedTaskTargets, - new RemoteAnimationTargetCompat[0] /* wallpaper */, - RemoteAnimationTargetCompat.wrap(nonAppTargets) /* nonApps */); + new RemoteAnimationTarget[0] /* wallpaper */, + nonAppTargets /* nonApps */); return; } - } else if (nonAppTargets != null && nonAppTargets.length > 0) { + } else if (nonAppTargets.length > 0) { TaskViewUtils.createSplitAuxiliarySurfacesAnimator( - RemoteAnimationTargetCompat.wrap(nonAppTargets) /* nonApps */, + nonAppTargets /* nonApps */, true /*shown*/, dividerAnimator -> { dividerAnimator.start(); dividerAnimator.end(); diff --git a/quickstep/src/com/android/quickstep/TaskUtils.java b/quickstep/src/com/android/quickstep/TaskUtils.java index d7227780c6..67360c4cc3 100644 --- a/quickstep/src/com/android/quickstep/TaskUtils.java +++ b/quickstep/src/com/android/quickstep/TaskUtils.java @@ -26,6 +26,7 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.os.UserHandle; import android.util.Log; +import android.view.RemoteAnimationTarget; import androidx.annotation.Nullable; @@ -34,7 +35,6 @@ import com.android.launcher3.util.ComponentKey; import com.android.launcher3.util.PackageManagerHelper; import com.android.systemui.shared.recents.model.Task; import com.android.systemui.shared.system.ActivityManagerWrapper; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.util.List; @@ -87,9 +87,9 @@ public final class TaskUtils { } - public static boolean taskIsATargetWithMode(RemoteAnimationTargetCompat[] targets, + public static boolean taskIsATargetWithMode(RemoteAnimationTarget[] targets, int taskId, int mode) { - for (RemoteAnimationTargetCompat target : targets) { + for (RemoteAnimationTarget target : targets) { if (target.mode == mode && target.taskId == taskId) { return true; } diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index bfebbbcbfa..7d6bbaccd1 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -15,6 +15,8 @@ */ package com.android.quickstep; +import static android.view.RemoteAnimationTarget.MODE_CLOSING; +import static android.view.RemoteAnimationTarget.MODE_OPENING; import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER; import static android.view.WindowManager.TRANSIT_OPEN; import static android.view.WindowManager.TRANSIT_TO_FRONT; @@ -35,8 +37,6 @@ import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.Interpolators.TOUCH_RESPONSE_INTERPOLATOR; import static com.android.launcher3.anim.Interpolators.clampToProgress; import static com.android.launcher3.statehandlers.DepthController.STATE_DEPTH; -import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING; -import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -51,6 +51,7 @@ import android.graphics.Matrix.ScaleToFit; import android.graphics.Rect; import android.graphics.RectF; import android.os.Build; +import android.view.RemoteAnimationTarget; import android.view.SurfaceControl; import android.view.View; import android.window.TransitionInfo; @@ -103,7 +104,7 @@ public final class TaskViewUtils { * opening remote target (which we don't get until onAnimationStart) will resolve to a TaskView. */ public static TaskView findTaskViewToLaunch( - RecentsView recentsView, View v, RemoteAnimationTargetCompat[] targets) { + RecentsView recentsView, View v, RemoteAnimationTarget[] targets) { if (v instanceof TaskView) { TaskView taskView = (TaskView) v; return recentsView.isTaskViewVisible(taskView) ? taskView : null; @@ -133,7 +134,7 @@ public final class TaskViewUtils { } // Resolve the opening task id int openingTaskId = -1; - for (RemoteAnimationTargetCompat target : targets) { + for (RemoteAnimationTarget target : targets) { if (target.mode == MODE_OPENING) { openingTaskId = target.taskId; break; @@ -156,9 +157,9 @@ public final class TaskViewUtils { public static void createRecentsWindowAnimator( @NonNull TaskView v, boolean skipViewChanges, - @NonNull RemoteAnimationTargetCompat[] appTargets, - @NonNull RemoteAnimationTargetCompat[] wallpaperTargets, - @NonNull RemoteAnimationTargetCompat[] nonAppTargets, + @NonNull RemoteAnimationTarget[] appTargets, + @NonNull RemoteAnimationTarget[] wallpaperTargets, + @NonNull RemoteAnimationTarget[] nonAppTargets, @Nullable DepthController depthController, PendingAnimation out) { RecentsView recentsView = v.getRecentsView(); @@ -168,7 +169,7 @@ public final class TaskViewUtils { final RemoteAnimationTargets targets = new RemoteAnimationTargets(appTargets, wallpaperTargets, nonAppTargets, MODE_OPENING); - final RemoteAnimationTargetCompat navBarTarget = targets.getNavBarRemoteAnimationTarget(); + final RemoteAnimationTarget navBarTarget = targets.getNavBarRemoteAnimationTarget(); SurfaceTransactionApplier applier = new SurfaceTransactionApplier(v); targets.addReleaseCheck(applier); @@ -410,12 +411,12 @@ public final class TaskViewUtils { } }); - final RemoteAnimationTargetCompat[] appTargets = + final RemoteAnimationTarget[] appTargets = RemoteAnimationTargetCompat.wrapApps(transitionInfo, t, null /* leashMap */); - final RemoteAnimationTargetCompat[] wallpaperTargets = + final RemoteAnimationTarget[] wallpaperTargets = RemoteAnimationTargetCompat.wrapNonApps( transitionInfo, true /* wallpapers */, t, null /* leashMap */); - final RemoteAnimationTargetCompat[] nonAppTargets = + final RemoteAnimationTarget[] nonAppTargets = RemoteAnimationTargetCompat.wrapNonApps( transitionInfo, false /* wallpapers */, t, null /* leashMap */); final RecentsView recentsView = launchingTaskView.getRecentsView(); @@ -492,9 +493,9 @@ public final class TaskViewUtils { public static void composeRecentsSplitLaunchAnimatorLegacy( @Nullable GroupedTaskView launchingTaskView, int initialTaskId, @Nullable PendingIntent initialTaskPendingIntent, int secondTaskId, - @NonNull RemoteAnimationTargetCompat[] appTargets, - @NonNull RemoteAnimationTargetCompat[] wallpaperTargets, - @NonNull RemoteAnimationTargetCompat[] nonAppTargets, + @NonNull RemoteAnimationTarget[] appTargets, + @NonNull RemoteAnimationTarget[] wallpaperTargets, + @NonNull RemoteAnimationTarget[] nonAppTargets, @NonNull StateManager stateManager, @Nullable DepthController depthController, @NonNull Runnable finishCallback) { @@ -517,7 +518,7 @@ public final class TaskViewUtils { final ArrayList openingTargets = new ArrayList<>(); final ArrayList closingTargets = new ArrayList<>(); - for (RemoteAnimationTargetCompat appTarget : appTargets) { + for (RemoteAnimationTarget appTarget : appTargets) { final int taskId = appTarget.taskInfo != null ? appTarget.taskInfo.taskId : -1; final int mode = appTarget.mode; final SurfaceControl leash = appTarget.leash; @@ -572,9 +573,9 @@ public final class TaskViewUtils { } public static void composeRecentsLaunchAnimator(@NonNull AnimatorSet anim, @NonNull View v, - @NonNull RemoteAnimationTargetCompat[] appTargets, - @NonNull RemoteAnimationTargetCompat[] wallpaperTargets, - @NonNull RemoteAnimationTargetCompat[] nonAppTargets, boolean launcherClosing, + @NonNull RemoteAnimationTarget[] appTargets, + @NonNull RemoteAnimationTarget[] wallpaperTargets, + @NonNull RemoteAnimationTarget[] nonAppTargets, boolean launcherClosing, @NonNull StateManager stateManager, @NonNull RecentsView recentsView, @Nullable DepthController depthController) { boolean skipLauncherChanges = !launcherClosing; @@ -666,7 +667,7 @@ public final class TaskViewUtils { * @return the animator animating the surfaces */ public static ValueAnimator createSplitAuxiliarySurfacesAnimator( - RemoteAnimationTargetCompat[] nonApps, boolean shown, + RemoteAnimationTarget[] nonApps, boolean shown, Consumer animatorHandler) { if (nonApps == null || nonApps.length == 0) { return null; @@ -676,7 +677,7 @@ public final class TaskViewUtils { List auxiliarySurfaces = new ArrayList<>(nonApps.length); boolean hasSurfaceToAnimate = false; for (int i = 0; i < nonApps.length; ++i) { - final RemoteAnimationTargetCompat targ = nonApps[i]; + final RemoteAnimationTarget targ = nonApps[i]; final SurfaceControl leash = targ.leash; if (targ.windowType == TYPE_DOCK_DIVIDER && leash != null && leash.isValid()) { auxiliarySurfaces.add(leash); diff --git a/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java index c131c055f6..8410149df6 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java @@ -37,6 +37,7 @@ import android.graphics.Matrix; import android.graphics.Point; import android.graphics.PointF; import android.view.MotionEvent; +import android.view.RemoteAnimationTarget; import android.view.VelocityTracker; import com.android.launcher3.R; @@ -59,7 +60,6 @@ import com.android.quickstep.util.TransformParams.BuilderProxy; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.InputMonitorCompat; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.util.HashMap; @@ -290,7 +290,7 @@ public class DeviceLockedInputConsumer implements InputConsumer, @Override public void onBuildTargetParams( - SurfaceProperties builder, RemoteAnimationTargetCompat app, TransformParams params) { + SurfaceProperties builder, RemoteAnimationTarget app, TransformParams params) { mMatrix.setTranslate(0, mProgress.value * mMaxTranslationY); builder.setMatrix(mMatrix); } diff --git a/quickstep/src/com/android/quickstep/util/RemoteAnimationProvider.java b/quickstep/src/com/android/quickstep/util/RemoteAnimationProvider.java index ee82ae67df..10f2eaa2f0 100644 --- a/quickstep/src/com/android/quickstep/util/RemoteAnimationProvider.java +++ b/quickstep/src/com/android/quickstep/util/RemoteAnimationProvider.java @@ -16,23 +16,22 @@ package com.android.quickstep.util; import android.animation.AnimatorSet; - -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; +import android.view.RemoteAnimationTarget; public abstract class RemoteAnimationProvider { - public abstract AnimatorSet createWindowAnimation(RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets); + public abstract AnimatorSet createWindowAnimation(RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets); /** * @return the target with the lowest opaque layer for a certain app animation, or null. */ - public static RemoteAnimationTargetCompat findLowestOpaqueLayerTarget( - RemoteAnimationTargetCompat[] appTargets, int mode) { + public static RemoteAnimationTarget findLowestOpaqueLayerTarget( + RemoteAnimationTarget[] appTargets, int mode) { int lowestLayer = Integer.MAX_VALUE; int lowestLayerIndex = -1; for (int i = appTargets.length - 1; i >= 0; i--) { - RemoteAnimationTargetCompat target = appTargets[i]; + RemoteAnimationTarget target = appTargets[i]; if (target.mode == mode && !target.isTranslucent) { int layer = target.prefixOrderIndex; if (layer < lowestLayer) { diff --git a/quickstep/src/com/android/quickstep/util/RemoteFadeOutAnimationListener.java b/quickstep/src/com/android/quickstep/util/RemoteFadeOutAnimationListener.java index b2e159ee10..382cf79e1e 100644 --- a/quickstep/src/com/android/quickstep/util/RemoteFadeOutAnimationListener.java +++ b/quickstep/src/com/android/quickstep/util/RemoteFadeOutAnimationListener.java @@ -15,14 +15,14 @@ */ package com.android.quickstep.util; -import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING; +import static android.view.RemoteAnimationTarget.MODE_CLOSING; import android.animation.ValueAnimator; import android.animation.ValueAnimator.AnimatorUpdateListener; +import android.view.RemoteAnimationTarget; import android.view.SurfaceControl.Transaction; import com.android.quickstep.RemoteAnimationTargets; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; /** * Animation listener which fades out the closing targets @@ -32,24 +32,24 @@ public class RemoteFadeOutAnimationListener implements AnimatorUpdateListener { private final RemoteAnimationTargets mTarget; private boolean mFirstFrame = true; - public RemoteFadeOutAnimationListener(RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets) { + public RemoteFadeOutAnimationListener(RemoteAnimationTarget[] appTargets, + RemoteAnimationTarget[] wallpaperTargets) { mTarget = new RemoteAnimationTargets(appTargets, wallpaperTargets, - new RemoteAnimationTargetCompat[0], MODE_CLOSING); + new RemoteAnimationTarget[0], MODE_CLOSING); } @Override public void onAnimationUpdate(ValueAnimator valueAnimator) { Transaction t = new Transaction(); if (mFirstFrame) { - for (RemoteAnimationTargetCompat target : mTarget.unfilteredApps) { + for (RemoteAnimationTarget target : mTarget.unfilteredApps) { t.show(target.leash); } mFirstFrame = false; } float alpha = 1 - valueAnimator.getAnimatedFraction(); - for (RemoteAnimationTargetCompat app : mTarget.apps) { + for (RemoteAnimationTarget app : mTarget.apps) { t.setAlpha(app.leash, alpha); } t.apply(); diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java index f07f9903c2..3119a7714e 100644 --- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java +++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java @@ -38,6 +38,7 @@ import android.text.TextUtils; import android.util.Log; import android.util.Pair; import android.view.RemoteAnimationAdapter; +import android.view.RemoteAnimationTarget; import android.view.SurfaceControl; import android.window.TransitionInfo; @@ -61,7 +62,6 @@ import com.android.quickstep.views.TaskView; import com.android.systemui.shared.recents.model.Task; import com.android.systemui.shared.system.RemoteAnimationAdapterCompat; import com.android.systemui.shared.system.RemoteAnimationRunnerCompat; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import com.android.systemui.shared.system.RemoteTransitionCompat; import com.android.systemui.shared.system.RemoteTransitionRunner; @@ -359,8 +359,8 @@ public class SplitSelectStateController { } @Override - public void onAnimationStart(int transit, RemoteAnimationTargetCompat[] apps, - RemoteAnimationTargetCompat[] wallpapers, RemoteAnimationTargetCompat[] nonApps, + public void onAnimationStart(int transit, RemoteAnimationTarget[] apps, + RemoteAnimationTarget[] wallpapers, RemoteAnimationTarget[] nonApps, Runnable finishedCallback) { postAsyncCallback(mHandler, () -> TaskViewUtils.composeRecentsSplitLaunchAnimatorLegacy( diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java index ff612f55b7..52f069e7b0 100644 --- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java +++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java @@ -35,6 +35,7 @@ import android.graphics.PointF; import android.graphics.Rect; import android.graphics.RectF; import android.util.Log; +import android.view.RemoteAnimationTarget; import androidx.annotation.NonNull; @@ -50,7 +51,6 @@ import com.android.quickstep.util.SurfaceTransaction.SurfaceProperties; import com.android.quickstep.views.TaskView.FullscreenDrawParams; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.recents.utilities.PreviewPositionHelper; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; /** * A utility class which emulates the layout behavior of TaskView and RecentsView @@ -171,8 +171,11 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { /** * Sets the targets which the simulator will control */ - public void setPreview(RemoteAnimationTargetCompat runningTarget) { - setPreviewBounds(runningTarget.startScreenSpaceBounds, runningTarget.contentInsets); + public void setPreview(RemoteAnimationTarget runningTarget) { + setPreviewBounds( + runningTarget.startBounds == null + ? runningTarget.screenSpaceBounds : runningTarget.startBounds, + runningTarget.contentInsets); } /** @@ -181,7 +184,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { * * @param splitInfo set to {@code null} when not in staged split mode */ - public void setPreview(RemoteAnimationTargetCompat runningTarget, SplitBounds splitInfo) { + public void setPreview(RemoteAnimationTarget runningTarget, SplitBounds splitInfo) { setPreview(runningTarget); mSplitBounds = splitInfo; if (mSplitBounds == null) { @@ -386,7 +389,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { @Override public void onBuildTargetParams( - SurfaceProperties builder, RemoteAnimationTargetCompat app, TransformParams params) { + SurfaceProperties builder, RemoteAnimationTarget app, TransformParams params) { builder.setMatrix(mMatrix) .setWindowCrop(mTmpCropRect) .setCornerRadius(getCurrentCornerRadius()); diff --git a/quickstep/src/com/android/quickstep/util/TransformParams.java b/quickstep/src/com/android/quickstep/util/TransformParams.java index 3d505c6234..aa9a45bd8b 100644 --- a/quickstep/src/com/android/quickstep/util/TransformParams.java +++ b/quickstep/src/com/android/quickstep/util/TransformParams.java @@ -15,14 +15,18 @@ */ package com.android.quickstep.util; +import static android.app.WindowConfiguration.ACTIVITY_TYPE_ASSISTANT; +import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME; +import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS; + import android.util.FloatProperty; +import android.view.RemoteAnimationTarget; import android.view.SurfaceControl; import com.android.launcher3.Utilities; import com.android.launcher3.anim.Interpolators; import com.android.quickstep.RemoteAnimationTargets; import com.android.quickstep.util.SurfaceTransaction.SurfaceProperties; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; public class TransformParams { @@ -140,16 +144,16 @@ public class TransformParams { mRecentsSurface = getRecentsSurface(targets); for (int i = 0; i < targets.unfilteredApps.length; i++) { - RemoteAnimationTargetCompat app = targets.unfilteredApps[i]; + RemoteAnimationTarget app = targets.unfilteredApps[i]; SurfaceProperties builder = transaction.forSurface(app.leash); if (app.mode == targets.targetMode) { - if (app.activityType == RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME) { + int activityType = app.windowConfiguration.getActivityType(); + if (activityType == ACTIVITY_TYPE_HOME) { mHomeBuilderProxy.onBuildTargetParams(builder, app, this); } else { // Fade out Assistant overlay. - if (app.activityType == RemoteAnimationTargetCompat.ACTIVITY_TYPE_ASSISTANT - && app.isNotInRecents) { + if (activityType == ACTIVITY_TYPE_ASSISTANT && app.isNotInRecents) { float progress = Utilities.boundToRange(getProgress(), 0, 1); builder.setAlpha(1 - Interpolators.DEACCEL_2_5.getInterpolation(progress)); } else { @@ -166,7 +170,7 @@ public class TransformParams { // always put wallpaper layer to bottom. final int wallpaperLength = targets.wallpapers != null ? targets.wallpapers.length : 0; for (int i = 0; i < wallpaperLength; i++) { - RemoteAnimationTargetCompat wallpaper = targets.wallpapers[i]; + RemoteAnimationTarget wallpaper = targets.wallpapers[i]; transaction.forSurface(wallpaper.leash).setLayer(Integer.MIN_VALUE); } return transaction; @@ -174,9 +178,9 @@ public class TransformParams { private static SurfaceControl getRecentsSurface(RemoteAnimationTargets targets) { for (int i = 0; i < targets.unfilteredApps.length; i++) { - RemoteAnimationTargetCompat app = targets.unfilteredApps[i]; + RemoteAnimationTarget app = targets.unfilteredApps[i]; if (app.mode == targets.targetMode) { - if (app.activityType == RemoteAnimationTargetCompat.ACTIVITY_TYPE_RECENTS) { + if (app.windowConfiguration.getActivityType() == ACTIVITY_TYPE_RECENTS) { return app.leash; } } else { @@ -223,6 +227,6 @@ public class TransformParams { BuilderProxy ALWAYS_VISIBLE = (builder, app, params) -> builder.setAlpha(1); void onBuildTargetParams(SurfaceProperties builder, - RemoteAnimationTargetCompat app, TransformParams params); + RemoteAnimationTarget app, TransformParams params); } } diff --git a/quickstep/src/com/android/quickstep/views/FloatingWidgetView.java b/quickstep/src/com/android/quickstep/views/FloatingWidgetView.java index 8a5f42afaf..6431bdf5aa 100644 --- a/quickstep/src/com/android/quickstep/views/FloatingWidgetView.java +++ b/quickstep/src/com/android/quickstep/views/FloatingWidgetView.java @@ -25,6 +25,7 @@ import android.os.Build; import android.util.AttributeSet; import android.util.Size; import android.view.GhostView; +import android.view.RemoteAnimationTarget; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver.OnGlobalLayoutListener; @@ -41,7 +42,6 @@ import com.android.launcher3.views.FloatingView; import com.android.launcher3.views.ListenerView; import com.android.launcher3.widget.LauncherAppWidgetHostView; import com.android.launcher3.widget.RoundedCornerEnforcement; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; /** A view that mimics an App Widget through a launch animation. */ @TargetApi(Build.VERSION_CODES.S) @@ -304,7 +304,7 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, * context's theme background color. */ public static int getDefaultBackgroundColor( - Context context, RemoteAnimationTargetCompat target) { + Context context, RemoteAnimationTarget target) { return (target != null && target.taskInfo.taskDescription != null) ? target.taskInfo.taskDescription.getBackgroundColor() : Themes.getColorBackground(context); diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index ab19487c11..88971e28da 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -104,6 +104,7 @@ import android.view.HapticFeedbackConstants; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.MotionEvent; +import android.view.RemoteAnimationTarget; import android.view.View; import android.view.ViewDebug; import android.view.ViewGroup; @@ -192,7 +193,6 @@ import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.InteractionJankMonitorWrapper; import com.android.systemui.shared.system.PackageManagerWrapper; -import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import com.android.systemui.shared.system.TaskStackChangeListener; import com.android.systemui.shared.system.TaskStackChangeListeners; import com.android.wm.shell.pip.IPipAnimationListener; @@ -1064,8 +1064,8 @@ public abstract class RecentsView