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

Commit 2bf11430 authored by Alex Chau's avatar Alex Chau Committed by Android (Google) Code Review
Browse files

Merge "Clean-up unnecessary desktop windowing flag usage" into main

parents ce01b91f 13b7ceef
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ import static android.view.View.VISIBLE;

import static com.android.launcher3.LauncherState.BACKGROUND_APP;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.window.flags.Flags.enableDesktopWindowingMode;

import android.os.Debug;
import android.os.SystemProperties;
@@ -136,9 +135,6 @@ public class DesktopVisibilityController {
            Log.d(TAG, "setVisibleFreeformTasksCount: visibleTasksCount=" + visibleTasksCount
                    + " currentValue=" + mVisibleFreeformTasksCount);
        }
        if (!enableDesktopWindowingMode()) {
            return;
        }

        if (visibleTasksCount != mVisibleFreeformTasksCount) {
            final boolean wasVisible = mVisibleFreeformTasksCount > 0;
@@ -180,9 +176,6 @@ public class DesktopVisibilityController {
            Log.d(TAG, "setOverviewStateEnabled: enabled=" + overviewStateEnabled
                    + " currentValue=" + mInOverviewState);
        }
        if (!enableDesktopWindowingMode()) {
            return;
        }
        if (overviewStateEnabled != mInOverviewState) {
            mInOverviewState = overviewStateEnabled;
            if (mInOverviewState) {
@@ -202,9 +195,6 @@ public class DesktopVisibilityController {
            Log.d(TAG, "setBackgroundStateEnabled: enabled=" + backgroundStateEnabled
                    + " currentValue=" + mBackgroundStateEnabled);
        }
        if (!enableDesktopWindowingMode()) {
            return;
        }
        if (backgroundStateEnabled != mBackgroundStateEnabled) {
            mBackgroundStateEnabled = backgroundStateEnabled;
            if (mBackgroundStateEnabled) {
@@ -229,9 +219,6 @@ public class DesktopVisibilityController {
     * Notify controller that recents gesture has started.
     */
    public void setRecentsGestureStart() {
        if (!enableDesktopWindowingMode()) {
            return;
        }
        if (DEBUG) {
            Log.d(TAG, "setRecentsGestureStart");
        }
@@ -243,9 +230,6 @@ public class DesktopVisibilityController {
     * {@link com.android.quickstep.GestureState.GestureEndTarget}
     */
    public void setRecentsGestureEnd(@Nullable GestureState.GestureEndTarget endTarget) {
        if (!enableDesktopWindowingMode()) {
            return;
        }
        if (DEBUG) {
            Log.d(TAG, "setRecentsGestureEnd: endTarget=" + endTarget);
        }
+7 −13
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@
 */
package com.android.launcher3.taskbar;

import static com.android.window.flags.Flags.enableDesktopWindowingMode;

import android.content.ComponentName;
import android.content.pm.ActivityInfo;

@@ -117,9 +115,7 @@ public final class KeyboardQuickSwitchController implements
        DesktopVisibilityController desktopController =
                LauncherActivityInterface.INSTANCE.getDesktopVisibilityController();
        final boolean onDesktop =
                enableDesktopWindowingMode()
                        && desktopController != null
                        && desktopController.areFreeformTasksVisible();
                desktopController != null && desktopController.areFreeformTasksVisible();

        if (mModel.isTaskListValid(mTaskListChangeId)) {
            // When we are opening the KQS with no focus override, check if the first task is
@@ -158,7 +154,6 @@ public final class KeyboardQuickSwitchController implements

        // Hide all desktop tasks and show them on the hidden tile
        int hiddenDesktopTasks = 0;
        if (enableDesktopWindowingMode()) {
        DesktopTask desktopTask = findDesktopTask(tasks);
        if (desktopTask != null) {
            hiddenDesktopTasks = desktopTask.tasks.size();
@@ -166,7 +161,6 @@ public final class KeyboardQuickSwitchController implements
                    .filter(t -> !(t instanceof DesktopTask))
                    .collect(Collectors.toCollection(ArrayList<GroupTask>::new));
        }
        }
        mTasks = tasks.stream()
                .limit(MAX_TASKS)
                .collect(Collectors.toList());
+1 −4
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import static com.android.launcher3.statemanager.BaseState.FLAG_NON_INTERACTIVE;
import static com.android.launcher3.taskbar.TaskbarEduTooltipControllerKt.TOOLTIP_STEP_FEATURES;
import static com.android.launcher3.taskbar.TaskbarLauncherStateController.FLAG_VISIBLE;
import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS;
import static com.android.window.flags.Flags.enableDesktopWindowingMode;

import android.animation.Animator;
import android.animation.AnimatorSet;
@@ -220,9 +219,7 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
        DesktopVisibilityController desktopController =
                LauncherActivityInterface.INSTANCE.getDesktopVisibilityController();
        final boolean onDesktop =
                enableDesktopWindowingMode()
                        && desktopController != null
                        && desktopController.areFreeformTasksVisible();
                desktopController != null && desktopController.areFreeformTasksVisible();
        if (onDesktop) {
            isVisible = false;
        }
+4 −7
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCH
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_IME_SWITCHER_BUTTON_TAP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_LONGPRESS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_OVERVIEW_BUTTON_TAP;
import static com.android.window.flags.Flags.enableDesktopWindowingMode;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING;
@@ -281,13 +280,11 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa
    private void navigateHome() {
        TaskUtils.closeSystemWindowsAsync(CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY);

        if (enableDesktopWindowingMode()) {
        DesktopVisibilityController desktopVisibilityController =
                LauncherActivityInterface.INSTANCE.getDesktopVisibilityController();
        if (desktopVisibilityController != null) {
            desktopVisibilityController.onHomeActionTriggered();
        }
        }

        mService.getOverviewCommandHelper().addCommand(OverviewCommandHelper.TYPE_HOME);
    }
+10 −11
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ public class QuickstepLauncher extends Launcher {
    private FixedContainerItems mAllAppsPredictions;
    private HotseatPredictionController mHotseatPredictionController;
    private DepthController mDepthController;
    private DesktopVisibilityController mDesktopVisibilityController;
    private @Nullable DesktopVisibilityController mDesktopVisibilityController;
    private QuickstepTransitionManager mAppTransitionManager;
    private OverviewActionsView mActionsView;
    private TISBindHelper mTISBindHelper;
@@ -276,8 +276,8 @@ public class QuickstepLauncher extends Launcher {

        mTISBindHelper = new TISBindHelper(this, this::onTISConnected);
        mDepthController = new DepthController(this);
        mDesktopVisibilityController = new DesktopVisibilityController(this);
        if (enableDesktopWindowingMode()) {
            mDesktopVisibilityController = new DesktopVisibilityController(this);
            mDesktopVisibilityController.registerSystemUiListener();
            mSplitSelectStateController.initSplitFromDesktopController(this);
        }
@@ -936,16 +936,14 @@ public class QuickstepLauncher extends Launcher {

    @Override
    public void setResumed() {
        if (enableDesktopWindowingMode()) {
            DesktopVisibilityController controller = mDesktopVisibilityController;
            if (controller != null && controller.areFreeformTasksVisible()
                    && !controller.isRecentsGestureInProgress()) {
        if (mDesktopVisibilityController != null
                && mDesktopVisibilityController.areFreeformTasksVisible()
                && !mDesktopVisibilityController.isRecentsGestureInProgress()) {
            // Return early to skip setting activity to appear as resumed
            // TODO(b/255649902): shouldn't be needed when we have a separate launcher state
            //  for desktop that we can use to control other parts of launcher
            return;
        }
        }
        super.setResumed();
    }

@@ -1078,6 +1076,7 @@ public class QuickstepLauncher extends Launcher {
        return mDepthController;
    }

    @Nullable
    public DesktopVisibilityController getDesktopVisibilityController() {
        return mDesktopVisibilityController;
    }
Loading