Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7286c5be authored by Tony Wickham's avatar Tony Wickham
Browse files

Add feature flag to force taskbar to be persistent.

This will allow us to test taskbar pinning before the entrypoint for
such a setting is finalized.

Test: manual, TODO: will need to update TaplTestsTaskbar to account for
this mode
Flag: FORCE_PERSISTENT_TASKBAR [off]
Bug: 258604917

Change-Id: I4535978563ffbe9a6cc6ece7720cdb75e787ff44
parent f6de6e36
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ import static android.view.HapticFeedbackConstants.LONG_PRESS;

import static com.android.launcher3.anim.Interpolators.FINAL_FRAME;
import static com.android.launcher3.anim.Interpolators.INSTANT;
import static com.android.launcher3.config.FeatureFlags.FORCE_PERSISTENT_TASKBAR;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_LONGPRESS_HIDE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_LONGPRESS_SHOW;
import static com.android.launcher3.taskbar.Utilities.appendFlag;
@@ -241,8 +242,9 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
        // it to work properly for tests that recreate taskbar. This check is here just to ensure
        // that taskbar unstashes when going to 3 button mode (supportsVisualStashing() false).
        boolean isManuallyStashedInApp = supportsVisualStashing()
                && mPrefs.getBoolean(SHARED_PREFS_STASHED_KEY, DEFAULT_STASHED_PREF)
                && !isTransientTaskbar;
                && !isTransientTaskbar
                && !FORCE_PERSISTENT_TASKBAR.get()
                && mPrefs.getBoolean(SHARED_PREFS_STASHED_KEY, DEFAULT_STASHED_PREF);
        boolean isInSetup = !mActivity.isUserSetupComplete() || setupUIVisible;
        updateStateForFlag(FLAG_STASHED_IN_APP_MANUAL, isManuallyStashedInApp);
        updateStateForFlag(FLAG_STASHED_IN_APP_AUTO, isTransientTaskbar);
@@ -270,6 +272,9 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
     * Returns whether the user can manually stash the taskbar based on the current device state.
     */
    protected boolean supportsManualStashing() {
        if (FORCE_PERSISTENT_TASKBAR.get()) {
            return false;
        }
        return supportsVisualStashing()
                && isInApp()
                && (!Utilities.IS_RUNNING_IN_TEST_HARNESS || mEnableManualStashingDuringTests)
+4 −0
Original line number Diff line number Diff line
@@ -338,6 +338,10 @@ public final class FeatureFlags {
            "ENABLE_TASKBAR_REVISED_THRESHOLDS", false,
            "Uses revised thresholds for transient taskbar.");

    public static final BooleanFlag FORCE_PERSISTENT_TASKBAR = getDebugFlag(
            "FORCE_PERSISTENT_TASKBAR", false, "Forces taskbar to be persistent, even in gesture"
                    + " nav mode and when transient taskbar is enabled.");

    public static final BooleanFlag ENABLE_TRANSIENT_TASKBAR = getDebugFlag(
            "ENABLE_TRANSIENT_TASKBAR", false, "Enables transient taskbar.");

+4 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;

import static com.android.launcher3.Utilities.dpiFromPx;
import static com.android.launcher3.config.FeatureFlags.ENABLE_TRANSIENT_TASKBAR;
import static com.android.launcher3.config.FeatureFlags.FORCE_PERSISTENT_TASKBAR;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.PackageManagerHelper.getPackageFilter;
import static com.android.launcher3.util.window.WindowManagerProxy.MIN_TABLET_WIDTH;
@@ -130,6 +131,9 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable {
     * Returns whether taskbar is transient.
     */
    public static boolean isTransientTaskbar(Context context) {
        if (FORCE_PERSISTENT_TASKBAR.get()) {
            return false;
        }
        return getNavigationMode(context) == NavigationMode.NO_BUTTON
                && (Utilities.IS_RUNNING_IN_TEST_HARNESS
                    ? sTransientTaskbarStatusForTests