Auto-Stashing Functionality for Pinned Taskbar

This cl includes :
- Refactor to remove unpinning/pinning in desktop mode with refactor of DisplayController, TaksbarPinningController, and its tests.
- Combined the auto stashing conditions under one method shouldAllowTaskbarToAutoStash() which takes in consideration isTransientTaskbar, isInDesktop, and Always Show Taskbar option is turned on/off in desktop mode.
- enabled taksbar divider popup support in desktop mode.
- Intorduced animation for pinned taksbar when autostadhing is enabled.
- Enable to onSwipeToUnstashTaskbar for TaskbarInputStashController for pinned taksbar in desktop mode.

Test: Presubmit, Unit, Manual
Bug: 381535785
Flag: com.android.window.flags.enable_desktop_windowing_mode
Change-Id: Ie5ecf3a3c72bf8dfadf2d0c908269305fe5bad0b
This commit is contained in:
Jagrut Desai
2025-04-25 09:46:12 -07:00
parent dd367a2218
commit f52ffc1232
14 changed files with 171 additions and 119 deletions

View File

@@ -117,6 +117,14 @@ class TaskbarPinningControllerTest : TaskbarBaseTestCase() {
verify(pinningController, times(1)).animateTaskbarPinning(PINNING_PERSISTENT)
}
@Test
fun testOnCloseCallback_whenLauncherPreferenceChanged_shouldNotAnimateToTaskbarInDesktopMode() {
isInDesktopMode = true
whenever(launcherPrefs.get(TASKBAR_PINNING_IN_DESKTOP_MODE)).thenReturn(false)
pinningController.onCloseCallback(true)
verify(pinningController, never()).animateTaskbarPinning(any())
}
@Test
fun testOnCloseCallback_whenLauncherPreferenceChanged_shouldAnimateToTransientTaskbar() {
whenever(launcherPrefs.get(TASKBAR_PINNING)).thenReturn(true)
@@ -211,13 +219,4 @@ class TaskbarPinningControllerTest : TaskbarBaseTestCase() {
assertThat(pinningController.isAnimatingTaskbarPinning).isFalse()
verify(launcherPrefs, times(1)).put(TASKBAR_PINNING, true)
}
@Test
fun testRecreateTaskbarAndUpdatePinningValue_whenAnimationEnds_shouldUpdateTaskbarPinningDesktopModePref() {
isInDesktopMode = true
pinningController.recreateTaskbarAndUpdatePinningValue()
verify(taskbarDragLayer, times(1)).setAnimatingTaskbarPinning(false)
assertThat(pinningController.isAnimatingTaskbarPinning).isFalse()
verify(launcherPrefs, times(1)).put(TASKBAR_PINNING_IN_DESKTOP_MODE, true)
}
}