Stash desktop apps on home gesture or taskbar home button press

When we detect the home gesture or tap on home button in taskbar,
check if desktop apps are visible. If they are, signal WMShell
to stash the desktop apps.

Flag: persist.wm.debug.desktop_mode_2
Bug: 261234402
Test: have gesture nav enabled, put an app on desktop and swipe up to
  home, verify toast is shown, and next app launches to desktop
Test: have 3-button nav enabled, put an app on desktop and press home,
  verify toast is shown, and next app launches to desktop
Change-Id: I824e640bfafa20cb3451cbd8f035fe9dca18094f
This commit is contained in:
Ats Jenk
2023-05-11 15:21:18 -07:00
parent 5c2f66e1ea
commit 7cd5a681f7
5 changed files with 105 additions and 0 deletions

View File

@@ -43,12 +43,15 @@ import androidx.annotation.StringRes;
import com.android.launcher3.R;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.statehandlers.DesktopVisibilityController;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.quickstep.LauncherActivityInterface;
import com.android.quickstep.OverviewCommandHelper;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskUtils;
import com.android.quickstep.TouchInteractionService;
import com.android.quickstep.views.DesktopTaskView;
import java.io.PrintWriter;
import java.lang.annotation.Retention;
@@ -267,6 +270,15 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa
private void navigateHome() {
TaskUtils.closeSystemWindowsAsync(CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY);
if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED) {
DesktopVisibilityController desktopVisibilityController =
LauncherActivityInterface.INSTANCE.getDesktopVisibilityController();
if (desktopVisibilityController != null) {
desktopVisibilityController.onHomeActionTriggered();
}
}
mService.getOverviewCommandHelper().addCommand(OverviewCommandHelper.TYPE_HOME);
}