From c0095e81ae65410bcb18bd9a37277cb64d7579a6 Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Wed, 28 Sep 2022 18:56:42 -0700 Subject: [PATCH] Remove ENABLE_QUICKSTEP_LIVE_TILE flag Fixes: 249627137 Test: manual - (1) swipe up from app (2) swipe home (3) quick switch (4) split in overview Change-Id: Ibe56ba3824b379b20fb3f0aa09be4d6bdb5abaa1 --- .../uioverrides/QuickstepLauncher.java | 7 +- .../NavBarToHomeTouchController.java | 13 +-- .../android/quickstep/AbsSwipeUpHandler.java | 57 ++++-------- .../quickstep/FallbackActivityInterface.java | 4 +- .../quickstep/LauncherActivityInterface.java | 6 +- .../android/quickstep/RecentsActivity.java | 11 +-- .../quickstep/TaskAnimationManager.java | 9 +- .../android/quickstep/TaskOverlayFactory.java | 13 +-- .../com/android/quickstep/TaskViewUtils.java | 3 +- .../quickstep/TouchInteractionService.java | 7 +- .../fallback/RecentsTaskController.java | 5 +- .../inputconsumers/OverviewInputConsumer.java | 29 +++--- .../quickstep/util/TaskViewSimulator.java | 3 +- .../android/quickstep/views/RecentsView.java | 89 +++++++------------ .../quickstep/views/TaskThumbnailView.java | 14 ++- .../com/android/quickstep/views/TaskView.java | 5 +- .../quickstep/AbstractQuickStepTest.java | 5 +- .../launcher3/config/FeatureFlags.java | 3 - 18 files changed, 94 insertions(+), 189 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 192ac6251e..4ca27b1145 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -29,7 +29,6 @@ import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK; import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT; import static com.android.launcher3.anim.Interpolators.EMPHASIZED; import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_WORKSPACE; import static com.android.launcher3.config.FeatureFlags.ENABLE_WIDGET_PICKER_DEPTH; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP; @@ -559,10 +558,8 @@ public class QuickstepLauncher extends Launcher { @Override protected void onScreenOff() { super.onScreenOff(); - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { - RecentsView recentsView = getOverviewPanel(); - recentsView.finishRecentsAnimation(true /* toRecents */, null); - } + RecentsView recentsView = getOverviewPanel(); + recentsView.finishRecentsAnimation(true /* toRecents */, null); } /** diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java index 30bb892c9a..40dfd82f5d 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java @@ -25,7 +25,6 @@ import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PULL_BACK_TRANSLATION; import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback; import static com.android.launcher3.anim.Interpolators.DEACCEL_3; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_GESTURE; import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS; @@ -139,9 +138,7 @@ public class NavBarToHomeTouchController implements TouchController, AnimatorControllerWithResistance.createRecentsResistanceFromOverviewAnim(mLauncher, builder); - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { - builder.addOnFrameCallback(recentsView::redrawLiveTile); - } + builder.addOnFrameCallback(recentsView::redrawLiveTile); AbstractFloatingView.closeOpenContainer(mLauncher, AbstractFloatingView.TYPE_TASK_MENU); } else if (mStartState == ALL_APPS) { @@ -182,11 +179,9 @@ public class NavBarToHomeTouchController implements TouchController, boolean success = interpolatedProgress >= SUCCESS_TRANSITION_PROGRESS || (velocity < 0 && fling); if (success) { - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { - RecentsView recentsView = mLauncher.getOverviewPanel(); - recentsView.switchToScreenshot(null, - () -> recentsView.finishRecentsAnimation(true /* toRecents */, null)); - } + RecentsView recentsView = mLauncher.getOverviewPanel(); + recentsView.switchToScreenshot(null, + () -> recentsView.finishRecentsAnimation(true /* toRecents */, null)); if (mStartState.overviewUi) { new OverviewToHomeAnim(mLauncher, () -> onSwipeInteractionCompleted(mEndState)) .animateWithVelocity(velocity); diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index f3630c187b..a78142d4b3 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -26,7 +26,6 @@ import static com.android.launcher3.PagedView.INVALID_PAGE; import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; import static com.android.launcher3.anim.Interpolators.DEACCEL; import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.IGNORE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_GESTURE; @@ -400,12 +399,6 @@ public abstract class AbsSwipeUpHandler, this::resetStateForAnimationCancel); mStateCallback.runOnceAtState(STATE_HANDLER_INVALIDATED | STATE_FINISH_WITH_NO_END, this::resetStateForAnimationCancel); - - if (!ENABLE_QUICKSTEP_LIVE_TILE.get()) { - mStateCallback.addChangeListener(STATE_APP_CONTROLLER_RECEIVED | STATE_LAUNCHER_PRESENT - | STATE_SCREENSHOT_VIEW_SHOWN | STATE_CAPTURE_SCREENSHOT, - (b) -> mRecentsView.setRunningTaskHidden(!b)); - } } protected boolean onActivityInit(Boolean alreadyOnHome) { @@ -583,14 +576,10 @@ public abstract class AbsSwipeUpHandler, } private void onDeferredActivityLaunch() { - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { - mActivityInterface.switchRunningTaskViewToScreenshot( - null, () -> { - mTaskAnimationManager.finishRunningRecentsAnimation(true /* toHome */); - }); - } else { - mTaskAnimationManager.finishRunningRecentsAnimation(true /* toHome */); - } + mActivityInterface.switchRunningTaskViewToScreenshot( + null, () -> { + mTaskAnimationManager.finishRunningRecentsAnimation(true /* toHome */); + }); } private void setupRecentsViewUi() { @@ -1719,8 +1708,7 @@ public abstract class AbsSwipeUpHandler, } private void invalidateHandler() { - if (!ENABLE_QUICKSTEP_LIVE_TILE.get() || !mActivityInterface.isInLiveTileMode() - || mGestureState.getEndTarget() != RECENTS) { + if (!mActivityInterface.isInLiveTileMode() || mGestureState.getEndTarget() != RECENTS) { mInputConsumerProxy.destroy(); mTaskAnimationManager.setLiveTileCleanUpHandler(null); } @@ -1765,10 +1753,6 @@ public abstract class AbsSwipeUpHandler, * continued quick switch gesture, which cancels the previous handler but doesn't invalidate it. */ private void resetLauncherListeners() { - // Reset the callback for deferred activity launches - if (!ENABLE_QUICKSTEP_LIVE_TILE.get()) { - mActivityInterface.setOnDeferredActivityLaunchCallback(null); - } mActivity.getRootView().setOnApplyWindowInsetsListener(null); mRecentsView.removeOnScrollChangedListener(mOnRecentsScrollListener); @@ -1790,7 +1774,6 @@ public abstract class AbsSwipeUpHandler, mStateCallback.setStateOnUiThread(STATE_SCREENSHOT_CAPTURED); } else { final int runningTaskId = mGestureState.getRunningTaskId(); - final boolean refreshView = !ENABLE_QUICKSTEP_LIVE_TILE.get() /* refreshView */; boolean finishTransitionPosted = false; if (mRecentsAnimationController != null) { // Update the screenshot of the task @@ -1801,14 +1784,14 @@ public abstract class AbsSwipeUpHandler, mRecentsAnimationController.screenshotTask(runningTaskId); MAIN_EXECUTOR.execute(() -> { mTaskSnapshot = taskSnapshot; - if (!updateThumbnail(runningTaskId, refreshView)) { + if (!updateThumbnail(runningTaskId, false /* refreshView */)) { setScreenshotCapturedState(); } }); }); return; } - finishTransitionPosted = updateThumbnail(runningTaskId, refreshView); + finishTransitionPosted = updateThumbnail(runningTaskId, false /* refreshView */); } if (!finishTransitionPosted) { setScreenshotCapturedState(); @@ -1846,17 +1829,9 @@ public abstract class AbsSwipeUpHandler, } private void finishCurrentTransitionToRecents() { - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { - mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED); - if (mRecentsAnimationController != null) { - mRecentsAnimationController.detachNavigationBarFromApp(true); - } - } else if (!hasTargets() || mRecentsAnimationController == null) { - // If there are no targets or the animation not started, then there is nothing to finish - mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED); - } else { - mRecentsAnimationController.finish(true /* toRecents */, - () -> mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED)); + mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED); + if (mRecentsAnimationController != null) { + mRecentsAnimationController.detachNavigationBarFromApp(true); } ActiveGestureLog.INSTANCE.addLog( /* event= */ "finishRecentsAnimation", @@ -1920,13 +1895,11 @@ public abstract class AbsSwipeUpHandler, } endLauncherTransitionController(); mRecentsView.onSwipeUpAnimationSuccess(); - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { - mTaskAnimationManager.setLiveTileCleanUpHandler(() -> { - mRecentsView.cleanupRemoteTargets(); - mInputConsumerProxy.destroy(); - }); - mTaskAnimationManager.enableLiveTileRestartListener(); - } + mTaskAnimationManager.setLiveTileCleanUpHandler(() -> { + mRecentsView.cleanupRemoteTargets(); + mInputConsumerProxy.destroy(); + }); + mTaskAnimationManager.enableLiveTileRestartListener(); SystemUiProxy.INSTANCE.get(mContext).onOverviewShown(false, TAG); doLogGesture(RECENTS, mRecentsView.getCurrentPageTaskView()); diff --git a/quickstep/src/com/android/quickstep/FallbackActivityInterface.java b/quickstep/src/com/android/quickstep/FallbackActivityInterface.java index 466abbe62f..6e963f3315 100644 --- a/quickstep/src/com/android/quickstep/FallbackActivityInterface.java +++ b/quickstep/src/com/android/quickstep/FallbackActivityInterface.java @@ -15,7 +15,6 @@ */ package com.android.quickstep; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.util.NavigationMode.NO_BUTTON; import static com.android.quickstep.fallback.RecentsState.BACKGROUND_APP; import static com.android.quickstep.fallback.RecentsState.DEFAULT; @@ -120,8 +119,7 @@ public final class FallbackActivityInterface extends public RecentsView getVisibleRecentsView() { RecentsActivity activity = getCreatedActivity(); if (activity != null) { - if (activity.hasBeenResumed() - || (ENABLE_QUICKSTEP_LIVE_TILE.get() && isInLiveTileMode())) { + if (activity.hasBeenResumed() || isInLiveTileMode()) { return activity.getOverviewPanel(); } } diff --git a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java index 1127e2c8e7..1cb17cb815 100644 --- a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java +++ b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java @@ -21,7 +21,6 @@ import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.LauncherState.QUICK_SWITCH; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import android.animation.Animator; @@ -203,8 +202,7 @@ public final class LauncherActivityInterface extends private Launcher getVisibleLauncher() { Launcher launcher = getCreatedActivity(); return (launcher != null) && launcher.isStarted() - && ((ENABLE_QUICKSTEP_LIVE_TILE.get() && isInLiveTileMode()) - || launcher.hasBeenResumed()) ? launcher : null; + && (isInLiveTileMode() || launcher.hasBeenResumed()) ? launcher : null; } @Override @@ -213,7 +211,7 @@ public final class LauncherActivityInterface extends if (launcher == null) { return false; } - if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isInLiveTileMode()) { + if (isInLiveTileMode()) { RecentsView recentsView = getVisibleRecentsView(); if (recentsView == null) { return false; diff --git a/quickstep/src/com/android/quickstep/RecentsActivity.java b/quickstep/src/com/android/quickstep/RecentsActivity.java index c879494c7d..4f5e216336 100644 --- a/quickstep/src/com/android/quickstep/RecentsActivity.java +++ b/quickstep/src/com/android/quickstep/RecentsActivity.java @@ -18,7 +18,6 @@ package com.android.quickstep; 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; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.graphics.SysUiScrim.SYSUI_PROGRESS; import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_STATE_ORDINAL; import static com.android.quickstep.OverviewComponentObserver.startHomeIntentSafely; @@ -393,13 +392,9 @@ public final class RecentsActivity extends StatefulActivity { } public void startHome() { - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { - RecentsView recentsView = getOverviewPanel(); - recentsView.switchToScreenshot(() -> recentsView.finishRecentsAnimation(true, - this::startHomeInternal)); - } else { - startHomeInternal(); - } + RecentsView recentsView = getOverviewPanel(); + recentsView.switchToScreenshot(() -> recentsView.finishRecentsAnimation(true, + this::startHomeInternal)); } private void startHomeInternal() { diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java index b9a1b0629f..7f1656500a 100644 --- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java +++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java @@ -15,7 +15,6 @@ */ package com.android.quickstep; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; 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; @@ -72,7 +71,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn return; } BaseActivityInterface activityInterface = mLastGestureState.getActivityInterface(); - if (ENABLE_QUICKSTEP_LIVE_TILE.get() && activityInterface.isInLiveTileMode() + if (activityInterface.isInLiveTileMode() && activityInterface.getCreatedActivity() != null) { RecentsView recentsView = activityInterface.getCreatedActivity().getOverviewPanel(); if (recentsView != null) { @@ -171,7 +170,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn .map(RemoteAnimationTargetCompat::unwrap) .toArray(RemoteAnimationTarget[]::new)); - if (ENABLE_QUICKSTEP_LIVE_TILE.get() && activityInterface.isInLiveTileMode() + if (activityInterface.isInLiveTileMode() && activityInterface.getCreatedActivity() != null) { RecentsView recentsView = activityInterface.getCreatedActivity().getOverviewPanel(); @@ -204,7 +203,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn @Override public boolean onSwitchToScreenshot(Runnable onFinished) { - if (!ENABLE_QUICKSTEP_LIVE_TILE.get() || !activityInterface.isInLiveTileMode() + if (!activityInterface.isInLiveTileMode() || activityInterface.getCreatedActivity() == null) { // No need to switch since tile is already a screenshot. onFinished.run(); @@ -266,7 +265,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn return; } BaseActivityInterface activityInterface = mLastGestureState.getActivityInterface(); - if (ENABLE_QUICKSTEP_LIVE_TILE.get() && activityInterface.isInLiveTileMode() + if (activityInterface.isInLiveTileMode() && activityInterface.getCreatedActivity() != null) { RecentsView recentsView = activityInterface.getCreatedActivity().getOverviewPanel(); if (recentsView != null) { diff --git a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java index e10cab60e0..d40f2ae017 100644 --- a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java +++ b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java @@ -18,7 +18,6 @@ package com.android.quickstep; import static android.view.Surface.ROTATION_0; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.quickstep.views.OverviewActionsView.DISABLED_NO_THUMBNAIL; import static com.android.quickstep.views.OverviewActionsView.DISABLED_ROTATED; @@ -174,14 +173,10 @@ public class TaskOverlayFactory implements ResourceBasedOverride { * @param callback callback to run, after switching to screenshot */ public void endLiveTileMode(@NonNull Runnable callback) { - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { - RecentsView recentsView = mThumbnailView.getTaskView().getRecentsView(); - recentsView.switchToScreenshot( - () -> recentsView.finishRecentsAnimation(true /* toRecents */, - false /* shouldPip */, callback)); - } else { - callback.run(); - } + RecentsView recentsView = mThumbnailView.getTaskView().getRecentsView(); + recentsView.switchToScreenshot( + () -> recentsView.finishRecentsAnimation(true /* toRecents */, + false /* shouldPip */, callback)); } /** diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index a96524e186..e7173f5c14 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -35,7 +35,6 @@ import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncest 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.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; 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; @@ -637,7 +636,7 @@ public final class TaskViewUtils { }; } pa.add(launcherAnim); - if (ENABLE_QUICKSTEP_LIVE_TILE.get() && recentsView.getRunningTaskIndex() != -1) { + if (recentsView.getRunningTaskIndex() != -1) { pa.addOnFrameCallback(recentsView::redrawLiveTile); } anim.play(pa.buildAnim()); diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 1999701f61..4476dcb3d8 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -20,7 +20,6 @@ import static android.view.MotionEvent.ACTION_DOWN; import static android.view.MotionEvent.ACTION_UP; import static com.android.launcher3.config.FeatureFlags.ASSISTANT_GIVES_LAUNCHER_FOCUS; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.quickstep.GestureState.DEFAULT_STATE; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_DOWN; @@ -955,8 +954,7 @@ public class TouchInteractionService extends Service boolean launcherResumedThroughShellTransition = gestureState.getActivityInterface().isResumed() && !previousGestureState.isRecentsAnimationRunning(); - if (ENABLE_QUICKSTEP_LIVE_TILE.get() - && gestureState.getActivityInterface().isInLiveTileMode()) { + if (gestureState.getActivityInterface().isInLiveTileMode()) { return createOverviewInputConsumer( previousGestureState, gestureState, @@ -1044,8 +1042,7 @@ public class TouchInteractionService extends Service previousGestureState.isRunningAnimationToLauncher(); boolean forcingOverviewInputConsumer = ASSISTANT_GIVES_LAUNCHER_FOCUS.get() && forceOverviewInputConsumer; - boolean isInLiveTileMode = ENABLE_QUICKSTEP_LIVE_TILE.get() - && gestureState.getActivityInterface().isInLiveTileMode(); + boolean isInLiveTileMode = gestureState.getActivityInterface().isInLiveTileMode(); reasonString.append(SUBSTRING_PREFIX) .append(hasWindowFocus ? "activity has window focus" diff --git a/quickstep/src/com/android/quickstep/fallback/RecentsTaskController.java b/quickstep/src/com/android/quickstep/fallback/RecentsTaskController.java index eca61bb07d..db4927a0d1 100644 --- a/quickstep/src/com/android/quickstep/fallback/RecentsTaskController.java +++ b/quickstep/src/com/android/quickstep/fallback/RecentsTaskController.java @@ -15,8 +15,6 @@ */ package com.android.quickstep.fallback; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; - import com.android.launcher3.uioverrides.touchcontrollers.TaskViewTouchController; import com.android.quickstep.RecentsActivity; @@ -28,8 +26,7 @@ public class RecentsTaskController extends TaskViewTouchController, T extends StatefulAct @Override public void onHoverEvent(MotionEvent ev) { - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { - mActivity.dispatchGenericMotionEvent(ev); - } + mActivity.dispatchGenericMotionEvent(ev); } @Override public void onKeyEvent(KeyEvent ev) { - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { - switch (ev.getKeyCode()) { - case KeyEvent.KEYCODE_VOLUME_DOWN: - case KeyEvent.KEYCODE_VOLUME_UP: - case KeyEvent.KEYCODE_VOLUME_MUTE: - MediaSessionManager mgr = mActivity.getSystemService(MediaSessionManager.class); - mgr.dispatchVolumeKeyEventAsSystemService(ev, - AudioManager.USE_DEFAULT_STREAM_TYPE); - break; - default: - break; - } - mActivity.dispatchKeyEvent(ev); + switch (ev.getKeyCode()) { + case KeyEvent.KEYCODE_VOLUME_DOWN: + case KeyEvent.KEYCODE_VOLUME_UP: + case KeyEvent.KEYCODE_VOLUME_MUTE: + MediaSessionManager mgr = mActivity.getSystemService(MediaSessionManager.class); + mgr.dispatchVolumeKeyEventAsSystemService(ev, + AudioManager.USE_DEFAULT_STREAM_TYPE); + break; + default: + break; } + mActivity.dispatchKeyEvent(ev); } } diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java index 1a026fc31d..4cdf557e3e 100644 --- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java +++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java @@ -17,7 +17,6 @@ package com.android.quickstep.util; import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.states.RotationHelper.deltaRotation; import static com.android.launcher3.touch.PagedOrientationHandler.MATRIX_POST_TRANSLATE; import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT; @@ -393,7 +392,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { .withCornerRadius(getCurrentCornerRadius()); // If mDrawsBelowRecents is unset, no reordering will be enforced. - if (ENABLE_QUICKSTEP_LIVE_TILE.get() && mDrawsBelowRecents != null) { + if (mDrawsBelowRecents != null) { // In legacy transitions, the animation leashes remain in same hierarchy in the // TaskDisplayArea, so we don't want to bump the layer too high otherwise it will // conflict with layers that WM core positions (ie. the input consumers). For shell diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 2f91e16566..4fba8d6385 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -41,7 +41,6 @@ import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.Interpolators.OVERSHOOT_0_75; import static com.android.launcher3.anim.Interpolators.clampToProgress; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_OVERVIEW_ACTIONS_SPLIT; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_CLEAR_ALL; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_DISMISS_SWIPE_UP; @@ -817,8 +816,7 @@ public abstract class RecentsView { - TaskViewSimulator simulator = remoteTargetHandle.getTaskViewSimulator(); - simulator.taskPrimaryTranslation.value = 0; - simulator.taskSecondaryTranslation.value = 0; - simulator.fullScreenProgress.value = 0; - simulator.recentsViewScale.value = 1; - }); - // Similar to setRunningTaskHidden below, reapply the state before runningTaskView is - // null. - if (!mRunningTaskShowScreenshot) { - setRunningTaskViewShowScreenshot(mRunningTaskShowScreenshot); - } + // resetTaskVisuals is called at the end of dismiss animation which could update + // primary and secondary translation of the live tile cut out. We will need to do so + // here accordingly. + runActionOnRemoteHandles(remoteTargetHandle -> { + TaskViewSimulator simulator = remoteTargetHandle.getTaskViewSimulator(); + simulator.taskPrimaryTranslation.value = 0; + simulator.taskSecondaryTranslation.value = 0; + simulator.fullScreenProgress.value = 0; + simulator.recentsViewScale.value = 1; + }); + // Similar to setRunningTaskHidden below, reapply the state before runningTaskView is + // null. + if (!mRunningTaskShowScreenshot) { + setRunningTaskViewShowScreenshot(mRunningTaskShowScreenshot); } if (mRunningTaskTileHidden) { setRunningTaskHidden(mRunningTaskTileHidden); @@ -2036,7 +2032,7 @@ public abstract class RecentsView { runActionOnRemoteHandles( remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator() @@ -3028,8 +3018,7 @@ public abstract class RecentsView { runActionOnRemoteHandles( remoteTargetHandle -> @@ -3123,8 +3112,7 @@ public abstract class RecentsView { runActionOnRemoteHandles( @@ -3247,8 +3235,7 @@ public abstract class RecentsView() { @Override public void accept(Boolean success) { - if (ENABLE_QUICKSTEP_LIVE_TILE.get() && mEnableDrawingLiveTile - && dismissedTaskView.isRunningTask() && success) { + if (mEnableDrawingLiveTile && dismissedTaskView.isRunningTask() && success) { finishRecentsAnimation(true /* toRecents */, false /* shouldPip */, () -> onEnd(success)); } else { @@ -3265,8 +3252,7 @@ public abstract class RecentsView removeTaskInternal(dismissedTaskViewId)); } else { @@ -3925,8 +3911,7 @@ public abstract class RecentsView remoteTargetHandle.getTaskViewSimulator() .taskPrimaryTranslation.value = totalTranslation); @@ -4150,10 +4135,8 @@ public abstract class RecentsView remoteTargetHandle.getTaskViewSimulator() - .addOverviewToAppAnim(mPendingAnimation, interpolator)); - mPendingAnimation.addOnFrameCallback(this::redrawLiveTile); - } + runActionOnRemoteHandles( + remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator() + .addOverviewToAppAnim(mPendingAnimation, interpolator)); + mPendingAnimation.addOnFrameCallback(this::redrawLiveTile); mPendingAnimation.addEndListener(isSuccess -> { if (isSuccess) { if (tv.getTaskIds()[1] != -1 && mRemoteTargetHandles != null) { @@ -4535,7 +4514,7 @@ public abstract class RecentsView