Prefer launching desktop tasks on freeform display

Update usages of TaskbarActivityContext.inDesktopMode to account for a
possibility of a desktop flavour taskbar (i.e. pinned taskbar that
shows desktop tasks) being shown outside desktop mode, which may be the
case on freeform displays (e.g. when
enable_desktop_taskbar_on_freeform_displays feature is enabled, or on
home). Tasks launched from this taskbar should preferably be launched
into desktop mode.

Bug: 390665752
Flag: com.android.window.flags.enable_desktop_taskbar_on_freeform_displays
Test: manual on desktop device. verify correct taskbar is shown
      on home screen, in overview, in desktop mode, with fullscreen
      app shown. Verify opening/launching apps from taskbar works
      as expected.

Change-Id: I8f198216d84fd165c2dcbf437c82e418e5c7405e
This commit is contained in:
Toni Barzic
2025-03-21 23:11:02 +00:00
parent 16210fa129
commit 1f4b265dde
6 changed files with 68 additions and 49 deletions
@@ -748,8 +748,9 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
}
private boolean shouldUpdateIconContentDescription(BubbleTextView btv) {
boolean isInDesktopMode = mControllers.taskbarDesktopModeController.isInDesktopMode(
DEFAULT_DISPLAY);
boolean isInDesktopMode =
mControllers.taskbarDesktopModeController.shouldShowDesktopTasksInTaskbar(
DEFAULT_DISPLAY);
boolean isAllAppsButton = btv instanceof TaskbarAllAppsButtonContainer;
boolean isDividerButton = btv instanceof TaskbarDividerContainer;
return isInDesktopMode && !isAllAppsButton && !isDividerButton;