Enable live tile in 3 button mode

- Previously we rely on whether launcher is resumed as a signal to see what "toggle" means. This no longer works since launcher is not resumed in Overview. Instead, we need to check the live tile signals.
- Use screenshot doesn't propagate after setting a new current task. So followed the logic around mRunningTaskIconScaledDown to work it out.
- Get rid of NavigationModeFeatureFlag, pending on 3rd party launcher change ag/14409355

Fixes: 185934639
Test: (1) Toggle overview from home screen and toggle back to fullscreen. (2) Toggle overview from app and keep toggling.

Change-Id: Iffaea18afb2179b5bb7dadda49e56efefa5658bc
This commit is contained in:
Tracy Zhou
2021-06-02 23:54:44 -07:00
parent e526fd6a00
commit d09ebe660f
19 changed files with 126 additions and 126 deletions
@@ -34,11 +34,11 @@ import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncest
import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_LAUNCH_TAP;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE;
import static java.lang.annotation.RetentionPolicy.SOURCE;
@@ -531,7 +531,7 @@ public class TaskView extends FrameLayout implements Reusable {
if (getTask() == null) {
return;
}
if (LIVE_TILE.get() && isRunningTask()) {
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isRunningTask()) {
if (!mIsClickableAsLiveTile) {
return;
}
@@ -593,6 +593,13 @@ public class TaskView extends FrameLayout implements Reusable {
ActivityOptionsWrapper opts = mActivity.getActivityLaunchOptions(this, null);
if (ActivityManagerWrapper.getInstance()
.startActivityFromRecents(mTask.key, opts.options)) {
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && getRecentsView().getRunningTaskId() != -1) {
// Return a fresh callback in the live tile case, so that it's not accidentally
// triggered by QuickstepTransitionManager.AppLaunchAnimationRunner.
RunnableList callbackList = new RunnableList();
getRecentsView().addSideTaskLaunchCallback(callbackList);
return callbackList;
}
return opts.onEndCallback;
} else {
notifyTaskLaunchFailed(TAG);
@@ -726,7 +733,7 @@ public class TaskView extends FrameLayout implements Reusable {
if (icon != null) {
mIconView.setDrawable(icon);
mIconView.setOnClickListener(v -> {
if (LIVE_TILE.get() && isRunningTask()) {
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isRunningTask()) {
RecentsView recentsView = getRecentsView();
recentsView.switchToScreenshot(
() -> recentsView.finishRecentsAnimation(true /* toRecents */,