Moving some more stuff behind the live tile feature flag
- With live tiles disabled, we are still calling
LauncherLayoutListener.update with shouldFinish=true, which can cause
the layout listener to be closed prior to the screenshot being taken
and shown. When we enable live tiles, it should obliviate the need to
switching to screenshot as well.
Bug: 122612839
Change-Id: I5c951ba2a486051016e9fed49e7f8f5dd015f8ea
diff --git a/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
index 8f1d46c..de6f7a7 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
@@ -18,6 +18,7 @@
import static com.android.launcher3.AbstractFloatingView.TYPE_QUICKSTEP_PREVIEW;
import static com.android.launcher3.LauncherAnimUtils.OVERVIEW_TRANSITION_MS;
import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
+import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.states.RotationHelper.REQUEST_ROTATE;
import android.graphics.Rect;
@@ -75,7 +76,11 @@
public void onStateEnabled(Launcher launcher) {
RecentsView rv = launcher.getOverviewPanel();
rv.setOverviewStateEnabled(true);
- AbstractFloatingView.closeAllOpenViewsExcept(launcher, TYPE_QUICKSTEP_PREVIEW);
+ if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
+ AbstractFloatingView.closeAllOpenViews(launcher);
+ } else {
+ AbstractFloatingView.closeAllOpenViewsExcept(launcher, TYPE_QUICKSTEP_PREVIEW);
+ }
}
@Override
diff --git a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
index fd4585b..9d48ec6 100644
--- a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -660,13 +660,13 @@
}
private void updateFinalShiftUi() {
- if (mRecentsAnimationWrapper.getController() != null && mLayoutListener != null) {
- if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
+ if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
+ if (mRecentsAnimationWrapper.getController() != null && mLayoutListener != null) {
mLayoutListener.open();
+ mLayoutListener.update(mCurrentShift.value > 1, mUiLongSwipeMode,
+ mClipAnimationHelper.getCurrentRectWithInsets(),
+ mClipAnimationHelper.getCurrentCornerRadius());
}
- mLayoutListener.update(mCurrentShift.value > 1, mUiLongSwipeMode,
- mClipAnimationHelper.getCurrentRectWithInsets(),
- mClipAnimationHelper.getCurrentCornerRadius());
}
final boolean passed = mCurrentShift.value >= MIN_PROGRESS_FOR_OVERVIEW;
diff --git a/quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java b/quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java
index ea73e2c..84033cb 100644
--- a/quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java
+++ b/quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java
@@ -16,6 +16,7 @@
package com.android.quickstep.util;
import static com.android.launcher3.anim.Interpolators.LINEAR;
+import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.quickstep.QuickScrubController.QUICK_SCRUB_TRANSLATION_Y_FACTOR;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING;
@@ -188,7 +189,7 @@
mTmpMatrix.setTranslate(app.position.x, app.position.y);
Rect crop = app.sourceContainerBounds;
float alpha = 1f;
- int layer;
+ int layer = RemoteAnimationProvider.getLayer(app, mBoostModeTargetLayers);
float cornerRadius = 0f;
float scale = params.currentRect.width() / crop.width();
if (app.mode == targetSet.targetMode) {
@@ -201,8 +202,7 @@
mCurrentCornerRadius = cornerRadius;
}
alpha = mTaskAlphaCallback.apply(app, params.targetAlpha);
- layer = RemoteAnimationProvider.getLayer(app, mBoostModeTargetLayers);
- } else {
+ } else if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
crop = null;
layer = Integer.MAX_VALUE;
}
diff --git a/quickstep/src/com/android/quickstep/views/LauncherLayoutListener.java b/quickstep/src/com/android/quickstep/views/LauncherLayoutListener.java
index bcd3aee..1e5ea5f 100644
--- a/quickstep/src/com/android/quickstep/views/LauncherLayoutListener.java
+++ b/quickstep/src/com/android/quickstep/views/LauncherLayoutListener.java
@@ -56,8 +56,10 @@
@Override
public void update(boolean shouldFinish, boolean isLongSwipe, RectF currentRect,
float cornerRadius) {
- if (!ENABLE_QUICKSTEP_LIVE_TILE.get() && shouldFinish) {
- finish();
+ if (!ENABLE_QUICKSTEP_LIVE_TILE.get()) {
+ if (shouldFinish) {
+ finish();
+ }
return;
}