mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 08:56:55 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user