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

Commit 7cc75c6a authored by Eghosa Ewansiha-Vlachavas's avatar Eghosa Ewansiha-Vlachavas Committed by Android (Google) Code Review
Browse files

Merge changes from topics "removeDesktopMode2", "replaceDesktopWindowingFlag" into main

* changes:
  [2/n] Remove use of `persist.wm.debug.desktop_mode_2`
  [2/n] Replace read-only desktop windowing flag with runtime flag
parents 6f7916d6 957bbcd9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -204,6 +204,7 @@ android_library {
        "com_android_launcher3_flags_lib",
        "com_android_wm_shell_flags_lib",
        "android.appwidget.flags-aconfig-java",
        "com.android.window.flags.window-aconfig-java",
    ],
    sdk_version: "current",
    min_sdk_version: min_launcher3_sdk_version,
+2 −14
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.RoundRectShape;
import android.os.SystemProperties;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseArray;
@@ -52,7 +51,7 @@ import com.android.quickstep.util.RecentsOrientedState;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.wm.shell.Flags;
import com.android.window.flags.Flags;

import kotlin.Unit;

@@ -69,11 +68,6 @@ import java.util.function.Consumer;
// TODO(b/249371338): TaskView needs to be refactored to have better support for N tasks.
public class DesktopTaskView extends TaskView {

    private static final boolean DESKTOP_MODE_SUPPORTED = SystemProperties.getBoolean(
            "persist.wm.debug.desktop_mode_2", false);

    private static final boolean ENABLE_DESKTOP_WINDOWING = Flags.enableDesktopWindowing();

    private static final String TAG = DesktopTaskView.class.getSimpleName();

    private static final boolean DEBUG = false;
@@ -96,13 +90,7 @@ public class DesktopTaskView extends TaskView {

    /** Check whether desktop windowing is enabled */
    public static boolean isDesktopModeSupported() {
        // Check for aconfig flag first
        if (ENABLE_DESKTOP_WINDOWING) {
            return true;
        }
        // Fall back to sysprop flag
        // TODO(b/304778354): remove sysprop once desktop aconfig flag supports dynamic overriding
        return DESKTOP_MODE_SUPPORTED;
        return Flags.enableDesktopWindowingMode();
    }

    public DesktopTaskView(Context context) {
+2 −7
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ import com.android.systemui.plugins.LauncherOverlayPlugin;
import com.android.systemui.plugins.PluginListener;
import com.android.systemui.plugins.shared.LauncherOverlayManager;
import com.android.systemui.plugins.shared.LauncherOverlayManager.LauncherOverlayTouchProxy;
import com.android.wm.shell.Flags;
import com.android.window.flags.Flags;

import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -319,10 +319,6 @@ public class Launcher extends StatefulActivity<LauncherState>
    private static final FloatProperty<Hotseat> HOTSEAT_WIDGET_SCALE =
            HOTSEAT_SCALE_PROPERTY_FACTORY.get(SCALE_INDEX_WIDGET_TRANSITION);

    private static final boolean ENABLE_DESKTOP_WINDOWING = Flags.enableDesktopWindowing();
    private static final boolean DESKTOP_MODE_SUPPORTED =
            "1".equals(Utilities.getSystemProperty("persist.wm.debug.desktop_mode_2", "0"));

    private final ModelCallbacks mModelCallbacks = createModelCallbacks();

    private final KeyboardShortcutsDelegate mKeyboardShortcutsDelegate =
@@ -2724,8 +2720,7 @@ public class Launcher extends StatefulActivity<LauncherState>
    }

    private void updateDisallowBack() {
        // TODO(b/304778354): remove sysprop once desktop aconfig flag supports dynamic overriding
        if (ENABLE_DESKTOP_WINDOWING || DESKTOP_MODE_SUPPORTED) {
        if (Flags.enableDesktopWindowingMode()) {
            // Do not disable back in launcher when prototype behavior is enabled
            return;
        }