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

View File

@@ -57,10 +57,17 @@ public abstract class BaseTaskbarContext extends BaseContext
public abstract NavigationMode getNavigationMode();
/**
* Returns whether the taskbar is in desktop mode.
* Returns whether the taskbar is in desktop mode. Implies that some desktop tasks are currently
* visible.
*/
public abstract boolean isInDesktopMode();
/**
* Returns whether the taskbar is showing desktop tasks, which may happen even outside desktop
* mode on freeform displays.
*/
public abstract boolean isTaskbarShowingDesktopTasks();
/**
* Returns whether the taskbar is forced to be pinned when home is visible.
*/