Use desktop mode autostashing on desktop devices

Updates few autostashing related conditions to use
`isTaskbarShowingDesktopApps()` instead of `isInDesktopMode()`, as the
former covers the case where the desktop flavour taskbar is shown
consistently (on desktop devices).

Bug: 390665752
Bug: 415991381
Flag: com.android.window.flags.enable_desktop_taskbar_on_freeform_displays
Test: On desktop device, verify that "Always show taskbar" is shown on
      home/in overview/in app outside desktop mode, and verify that the popup
      value shown is consistent with the value in desktop mode. Verify
      that taskbar does not get auto-stashed on home, even if "Always
      show Taskbar" value is false.
Change-Id: I4edfe20f5526210fdf767231d0906875fe04f806
This commit is contained in:
Toni Barzic
2025-05-03 23:04:22 +00:00
parent 37437bafc5
commit 2cf0d817a3
5 changed files with 38 additions and 6 deletions
@@ -653,11 +653,13 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
* @return if we should allow taskbar to auto stash
*/
public boolean shouldAllowTaskbarToAutoStash() {
boolean isTransientTaskbar = mActivity.isTransientTaskbar();
boolean isInDesktop = mActivity.isInDesktopMode();
if (mActivity.isTransientTaskbar()) {
return true;
}
boolean isTaskbarPinningOnInDesktopMode = LauncherPrefs.TASKBAR_PINNING_IN_DESKTOP_MODE.get(
mActivity);
return isTransientTaskbar || (isInDesktop && !isTaskbarPinningOnInDesktopMode);
return !isTaskbarPinningOnInDesktopMode && mActivity.isTaskbarShowingDesktopTasks();
}
/**
@@ -688,7 +690,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
}
if (mActivity.isTransientTaskbar()) {
updateAndAnimateTransientTaskbar(!hasAnyFlag(FLAG_STASHED_IN_APP_AUTO));
} else if (mActivity.isInDesktopMode()) {
} else if (mActivity.isTaskbarShowingDesktopTasks()) {
updateAndAnimatePinnedTaskbar(!hasAnyFlag(FLAG_STASHED_IN_APP_AUTO));
}
}