From 8121e0d8b1d861bea3de068fba28931e9ccd2fab Mon Sep 17 00:00:00 2001 From: Ats Jenk Date: Thu, 1 Dec 2022 11:34:43 -0800 Subject: [PATCH] Add a flag to not disable back gesture in launcher Desktop mode prototypes enable freeform tasks on top of launcher. Launcher is still partially visible in the back which means that launcher will disable back gesture for the freeform tasks. When desktop mode prototype 1 or 2 is enabled, skip disabling the back gesture on launcher. Bug: 259280363 Test: manual, enable desktop mode and launch an app, try back gesture from edge Change-Id: I1d5eb81c7b28fb452c9566e358d77a5b2c19d450 --- src/com/android/launcher3/Launcher.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 5cce407d0b..1a6c68dd6a 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -313,6 +313,12 @@ public class Launcher extends StatefulActivity private static final FloatProperty HOTSEAT_WIDGET_SCALE = HOTSEAT_SCALE_PROPERTY_FACTORY.get(SCALE_INDEX_WIDGET_TRANSITION); + private static final boolean DESKTOP_MODE_1_SUPPORTED = + "1".equals(Utilities.getSystemProperty("persist.wm.debug.desktop_mode", "0")); + + private static final boolean DESKTOP_MODE_2_SUPPORTED = + "1".equals(Utilities.getSystemProperty("persist.wm.debug.desktop_mode_2", "0")); + @Thunk Workspace mWorkspace; @Thunk @@ -3154,6 +3160,10 @@ public class Launcher extends StatefulActivity } private void updateDisallowBack() { + if (DESKTOP_MODE_1_SUPPORTED || DESKTOP_MODE_2_SUPPORTED) { + // Do not disable back in launcher when prototype behavior is enabled + return; + } LauncherRootView rv = getRootView(); if (rv != null) { boolean disableBack = getStateManager().getState() == NORMAL