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

Commit 6fe69f5a authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Migrate HIDE_NAVBAR_WINDOW to aconfig and rename is to enable_taskbar_navbar_unification

Bug: 309671494
Test: N/A
Change-Id: If35d807c17351146029498a876a055384eff3c2f
parent 38dc539f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -734,7 +734,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
        // TODO(b/244231596) we're getting the incorrect kidsMode value in small-screen
        boolean isInKidsMode = mContext.isNavBarKidsModeActive();

        if (TaskbarManager.FLAG_HIDE_NAVBAR_WINDOW) {
        if (TaskbarManager.ENABLE_TASKBAR_NAVBAR_UNIFICATION) {
            NavButtonLayoutter navButtonLayoutter =
                    NavButtonLayoutFactory.Companion.getUiLayoutter(
                            dp, mNavButtonsView, mImeSwitcherButton,
+5 −5
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ import static com.android.launcher3.config.FeatureFlags.enableTaskbarNoRecreate;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN;
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_DRAGGING;
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_FULLSCREEN;
import static com.android.launcher3.taskbar.TaskbarManager.FLAG_HIDE_NAVBAR_WINDOW;
import static com.android.launcher3.taskbar.TaskbarManager.ENABLE_TASKBAR_NAVBAR_UNIFICATION;
import static com.android.launcher3.testing.shared.ResourceUtils.getBoolByName;
import static com.android.launcher3.util.VibratorWrapper.EFFECT_CLICK;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE;
@@ -354,7 +354,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
                sharedState.systemBarAttrsBehavior);
        onNavButtonsDarkIntensityChanged(sharedState.navButtonsDarkIntensity);

        if (FLAG_HIDE_NAVBAR_WINDOW) {
        if (ENABLE_TASKBAR_NAVBAR_UNIFICATION) {
            // W/ the flag not set this entire class gets re-created, which resets the value of
            // mIsDestroyed. We re-use the class for small-screen, so we explicitly have to mark
            // this class as non-destroyed
@@ -454,7 +454,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
     */
    private WindowManager.LayoutParams createAllWindowParams() {
        final int windowType =
                FLAG_HIDE_NAVBAR_WINDOW ? TYPE_NAVIGATION_BAR : TYPE_NAVIGATION_BAR_PANEL;
                ENABLE_TASKBAR_NAVBAR_UNIFICATION ? TYPE_NAVIGATION_BAR : TYPE_NAVIGATION_BAR_PANEL;
        WindowManager.LayoutParams windowLayoutParams =
                createDefaultWindowLayoutParams(windowType, TaskbarActivityContext.WINDOW_TITLE);
        boolean isPhoneNavMode = TaskbarManager.isPhoneButtonNavMode(this);
@@ -719,7 +719,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
        mIsDestroyed = true;
        setUIController(TaskbarUIController.DEFAULT);
        mControllers.onDestroy();
        if (!enableTaskbarNoRecreate() && !FLAG_HIDE_NAVBAR_WINDOW) {
        if (!enableTaskbarNoRecreate() && !ENABLE_TASKBAR_NAVBAR_UNIFICATION) {
            mWindowManager.removeViewImmediate(mDragLayer);
            mAddedWindow = false;
        }
@@ -860,7 +860,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
    public int getDefaultTaskbarWindowHeight() {
        Resources resources = getResources();

        if (FLAG_HIDE_NAVBAR_WINDOW && mDeviceProfile.isPhone) {
        if (ENABLE_TASKBAR_NAVBAR_UNIFICATION && mDeviceProfile.isPhone) {
            return isThreeButtonNav() ?
                    resources.getDimensionPixelSize(R.dimen.taskbar_size) :
                    resources.getDimensionPixelSize(R.dimen.taskbar_stashed_size);
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ public class TaskbarDragLayer extends BaseDragLayer<TaskbarActivityContext> {
    }

    protected void onDestroy() {
        onDestroy(!TaskbarManager.FLAG_HIDE_NAVBAR_WINDOW);
        onDestroy(!TaskbarManager.ENABLE_TASKBAR_NAVBAR_UNIFICATION);
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -253,7 +253,7 @@ class TaskbarInsetsController(val context: TaskbarActivityContext) : LoggableTas
                                visInsetsSizeForTappableElement
                        ),
                )
        if ((context.isGestureNav || TaskbarManager.FLAG_HIDE_NAVBAR_WINDOW)
        if ((context.isGestureNav || TaskbarManager.ENABLE_TASKBAR_NAVBAR_UNIFICATION)
                && provider.type == tappableElement()) {
            provider.insetsSizeOverrides = insetsSizeOverrideForTappableElement
        } else if (provider.type != systemGestures()) {
+10 −9
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import android.content.res.Configuration;
import android.hardware.display.DisplayManager;
import android.net.Uri;
import android.os.Handler;
import android.os.SystemProperties;
import android.os.Trace;
import android.provider.Settings;
import android.util.Log;
@@ -71,6 +70,7 @@ import com.android.quickstep.util.AssistUtils;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.unfold.UnfoldTransitionProgressProvider;
import com.android.systemui.unfold.util.ScopedUnfoldTransitionProgressProvider;
import com.android.wm.shell.Flags;

import java.io.PrintWriter;
import java.util.StringJoiner;
@@ -98,8 +98,8 @@ public class TaskbarManager {
            | ActivityInfo.CONFIG_SCREEN_LAYOUT
            | ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE;

    public static final boolean FLAG_HIDE_NAVBAR_WINDOW =
            SystemProperties.getBoolean("persist.wm.debug.hide_navbar_window", false);
    public static final boolean ENABLE_TASKBAR_NAVBAR_UNIFICATION =
            Flags.enableTaskbarNavbarUnification();

    private static final Uri USER_SETUP_COMPLETE_URI = Settings.Secure.getUriFor(
            Settings.Secure.USER_SETUP_COMPLETE);
@@ -198,7 +198,8 @@ public class TaskbarManager {
        Display display =
                service.getSystemService(DisplayManager.class).getDisplay(DEFAULT_DISPLAY);
        mContext = service.createWindowContext(display,
                FLAG_HIDE_NAVBAR_WINDOW ? TYPE_NAVIGATION_BAR : TYPE_NAVIGATION_BAR_PANEL, null);
                ENABLE_TASKBAR_NAVBAR_UNIFICATION ? TYPE_NAVIGATION_BAR : TYPE_NAVIGATION_BAR_PANEL,
                null);
        if (enableTaskbarNoRecreate()) {
            mWindowManager = mContext.getSystemService(WindowManager.class);
            mTaskbarRootLayout = new FrameLayout(mContext) {
@@ -250,7 +251,7 @@ public class TaskbarManager {
                        destroyExistingTaskbar();
                    } else {
                        if (dp != null && isTaskbarPresent(dp)) {
                            if (FLAG_HIDE_NAVBAR_WINDOW) {
                            if (ENABLE_TASKBAR_NAVBAR_UNIFICATION) {
                                // Re-initialize for screen size change? Should this be done
                                // by looking at screen-size change flag in configDiff in the
                                // block above?
@@ -295,7 +296,7 @@ public class TaskbarManager {
        debugWhyTaskbarNotDestroyed("destroyExistingTaskbar: " + mTaskbarActivityContext);
        if (mTaskbarActivityContext != null) {
            mTaskbarActivityContext.onDestroy();
            if (!FLAG_HIDE_NAVBAR_WINDOW || enableTaskbarNoRecreate()) {
            if (!ENABLE_TASKBAR_NAVBAR_UNIFICATION || enableTaskbarNoRecreate()) {
                mTaskbarActivityContext = null;
            }
        }
@@ -427,7 +428,7 @@ public class TaskbarManager {
            boolean isTaskbarEnabled = dp != null && isTaskbarPresent(dp);
            debugWhyTaskbarNotDestroyed("recreateTaskbar: isTaskbarEnabled=" + isTaskbarEnabled
                + " [dp != null (i.e. mUserUnlocked)]=" + (dp != null)
                + " FLAG_HIDE_NAVBAR_WINDOW=" + FLAG_HIDE_NAVBAR_WINDOW
                + " FLAG_HIDE_NAVBAR_WINDOW=" + ENABLE_TASKBAR_NAVBAR_UNIFICATION
                + " dp.isTaskbarPresent=" + (dp == null ? "null" : dp.isTaskbarPresent));
            if (!isTaskbarEnabled) {
                SystemUiProxy.INSTANCE.get(mContext)
@@ -493,7 +494,7 @@ public class TaskbarManager {
     *                      and we are using a single window for taskbar and navbar.
     */
    public static boolean isPhoneMode(DeviceProfile deviceProfile) {
        return TaskbarManager.FLAG_HIDE_NAVBAR_WINDOW && deviceProfile.isPhone;
        return TaskbarManager.ENABLE_TASKBAR_NAVBAR_UNIFICATION && deviceProfile.isPhone;
    }

    /**
@@ -505,7 +506,7 @@ public class TaskbarManager {
    }

    private boolean isTaskbarPresent(DeviceProfile deviceProfile) {
        return FLAG_HIDE_NAVBAR_WINDOW || deviceProfile.isTaskbarPresent;
        return ENABLE_TASKBAR_NAVBAR_UNIFICATION || deviceProfile.isTaskbarPresent;
    }

    public void onRotationProposal(int rotation, boolean isValid) {
Loading