Use aconfig flag for desktop mode
Refactors all flag access in Launcher to be from DesktopTaskView and using a method instead of a static field.
Also using static import for the method so if we need to move it, only imports needs to be updated.
Bug: 304778354
Flag: ACONFIG com.android.wm.shell.enable_desktop_windowing TEAMFOOD
Test: enable the aconfig flag, check that desktop windowing is available
Change-Id: Ia2bdfd865802a635878d72cfb5a90c21dad6ed08
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 9255ff4..1f64cd8 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -237,6 +237,7 @@
import com.android.systemui.plugins.PluginListener;
import com.android.systemui.plugins.shared.LauncherOverlayManager;
import com.android.systemui.plugins.shared.LauncherOverlayManager.LauncherOverlay;
+import com.android.wm.shell.Flags;
import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -330,6 +331,7 @@
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"));
@@ -3044,7 +3046,8 @@
}
private void updateDisallowBack() {
- if (DESKTOP_MODE_SUPPORTED) {
+ // TODO(b/304778354): remove sysprop once desktop aconfig flag supports dynamic overriding
+ if (ENABLE_DESKTOP_WINDOWING || DESKTOP_MODE_SUPPORTED) {
// Do not disable back in launcher when prototype behavior is enabled
return;
}