diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java index 1d55da325e..3e7d45ed47 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java @@ -21,9 +21,9 @@ import android.content.Context; import android.graphics.Rect; import com.android.launcher3.BaseDraggingActivity; -import com.android.launcher3.Flags; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; +import com.android.launcher3.config.FeatureFlags; import com.android.quickstep.views.RecentsView; /** @@ -72,7 +72,7 @@ public class OverviewModalTaskState extends OverviewState { @Override public boolean isTaskbarStashed(Launcher launcher) { - if (Flags.enableGridOnlyOverview()) { + if (FeatureFlags.enableGridOnlyOverview()) { return true; } return super.isTaskbarStashed(launcher); diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index 25389c5a09..8925bd61e2 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -50,10 +50,10 @@ import androidx.annotation.Nullable; import androidx.annotation.UiThread; import com.android.launcher3.DeviceProfile; -import com.android.launcher3.Flags; import com.android.launcher3.R; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.PendingAnimation; +import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.statehandlers.DepthController; import com.android.launcher3.statehandlers.DesktopVisibilityController; import com.android.launcher3.statemanager.BaseState; @@ -242,7 +242,7 @@ public abstract class BaseActivityInterface extends FrameLayo return 0; } - if (mDp.isTablet && Flags.enableGridOnlyOverview()) { + if (mDp.isTablet && FeatureFlags.enableGridOnlyOverview()) { return mDp.stashedTaskbarHeight; } diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 60fff915fc..825c0ae3f0 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -42,7 +42,7 @@ import static com.android.launcher3.Utilities.EDGE_NAV_BAR; import static com.android.launcher3.Utilities.mapToRange; import static com.android.launcher3.Utilities.squaredHypot; import static com.android.launcher3.Utilities.squaredTouchSlop; -import static com.android.launcher3.Flags.enableGridOnlyOverview; +import static com.android.launcher3.config.FeatureFlags.enableGridOnlyOverview; 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; diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index 2096723e2c..6ae19738fa 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -77,7 +77,6 @@ import androidx.annotation.VisibleForTesting; import com.android.app.animation.Interpolators; import com.android.launcher3.DeviceProfile; -import com.android.launcher3.Flags; import com.android.launcher3.LauncherSettings; import com.android.launcher3.R; import com.android.launcher3.Utilities; @@ -115,8 +114,6 @@ import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.QuickStepContract; -import kotlin.Unit; - import java.lang.annotation.Retention; import java.util.Arrays; import java.util.Collections; @@ -125,6 +122,8 @@ import java.util.List; import java.util.function.Consumer; import java.util.stream.Stream; +import kotlin.Unit; + /** * A task in the Recents view. */ @@ -1154,7 +1153,7 @@ public class TaskView extends FrameLayout implements Reusable { } else if (dp.isTablet) { int alignedOptionIndex = 0; if (getRecentsView().isOnGridBottomRow(menuContainer.getTaskView()) && dp.isLandscape) { - if (Flags.enableGridOnlyOverview()) { + if (FeatureFlags.enableGridOnlyOverview()) { // With no focused task, there is less available space below the tasks, so align // the arrow to the third option in the menu. alignedOptionIndex = 2; diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index f61723a36b..94eb7a352e 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -1761,7 +1761,7 @@ public class DeviceProfile { /** Gets the space that the overview actions will take, including bottom margin. */ public int getOverviewActionsClaimedSpace() { - int overviewActionsSpace = isTablet && Flags.enableGridOnlyOverview() + int overviewActionsSpace = isTablet && FeatureFlags.enableGridOnlyOverview() ? 0 : (overviewActionsTopMarginPx + overviewActionsHeight); return overviewActionsSpace + getOverviewActionsClaimedSpaceBelow(); diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index 289a8578f3..a3c434ac08 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -317,6 +317,16 @@ public final class FeatureFlags { + "waiting for SystemUI and then merging the SystemUI progress whenever we " + "start receiving the events"); + // TODO(Block 23): Clean up flags + // Aconfig migration complete for ENABLE_GRID_ONLY_OVERVIEW. + @VisibleForTesting + public static final BooleanFlag ENABLE_GRID_ONLY_OVERVIEW = getDebugFlag(270397206, + "ENABLE_GRID_ONLY_OVERVIEW", TEAMFOOD, + "Enable a grid-only overview without a focused task."); + public static boolean enableGridOnlyOverview() { + return ENABLE_GRID_ONLY_OVERVIEW.get() || Flags.enableGridOnlyOverview(); + } + // Aconfig migration complete for ENABLE_OVERVIEW_ICON_MENU. @VisibleForTesting public static final BooleanFlag ENABLE_OVERVIEW_ICON_MENU = getDebugFlag(257950105, diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java index e52e878d87..a75f32602e 100644 --- a/src/com/android/launcher3/testing/TestInformationHandler.java +++ b/src/com/android/launcher3/testing/TestInformationHandler.java @@ -16,7 +16,7 @@ package com.android.launcher3.testing; import static com.android.launcher3.allapps.AllAppsStore.DEFER_UPDATES_TEST; -import static com.android.launcher3.Flags.enableGridOnlyOverview; +import static com.android.launcher3.config.FeatureFlags.enableGridOnlyOverview; import static com.android.launcher3.config.FeatureFlags.FOLDABLE_SINGLE_PAGE; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;