From cf25610a288e0a333a36a77d5c52aec4883df989 Mon Sep 17 00:00:00 2001 From: Ats Jenk Date: Tue, 25 Jul 2023 14:20:00 -0700 Subject: [PATCH] Flag stashing desktop when going home Put logic to stash desktop apps behind a flag. Turn it off by default. Bug: 292109910 Flag: persist.wm.debug.desktop_stashing Test: turn off the flag, open an app on the desktop and go home observe that user is taken to home screen and subsequent launches are in full screen turn on the flag, open app on the desktop and go home observe that there is a toast shown for desktop and next app is launched to desktop Change-Id: Ic6f9a3644bb09d4fb877f4694843a7c20969f925 --- .../statehandlers/DesktopVisibilityController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java b/quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java index 7283a184d7..dc4441d6c4 100644 --- a/quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java +++ b/quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java @@ -39,7 +39,8 @@ public class DesktopVisibilityController { private static final String TAG = "DesktopVisController"; private static final boolean DEBUG = false; - + private static final boolean IS_STASHING_ENABLED = SystemProperties.getBoolean( + "persist.wm.debug.desktop_stashing", false); private final Launcher mLauncher; private boolean mFreeformTasksVisible; @@ -73,6 +74,9 @@ public class DesktopVisibilityController { @Override public void onStashedChanged(int displayId, boolean stashed) { + if (!IS_STASHING_ENABLED) { + return; + } MAIN_EXECUTOR.execute(() -> { if (displayId == mLauncher.getDisplayId()) { if (DEBUG) { @@ -189,7 +193,7 @@ public class DesktopVisibilityController { * Handle launcher moving to home due to home gesture or home button press. */ public void onHomeActionTriggered() { - if (areFreeformTasksVisible()) { + if (IS_STASHING_ENABLED && areFreeformTasksVisible()) { SystemUiProxy.INSTANCE.get(mLauncher).stashDesktopApps(mLauncher.getDisplayId()); } }