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:
1 parent
dd367a2218
commit
f52ffc1232
14 files changed
+171
-119
No files matched your search
@@ -28,11 +28,9 @@ import androidx.test.annotation.UiThreadTest
|
||||
import androidx.test.filters.SmallTest
|
||||
import com.android.launcher3.LauncherPrefs
|
||||
import com.android.launcher3.LauncherPrefs.Companion.TASKBAR_PINNING
|
||||
import com.android.launcher3.LauncherPrefs.Companion.TASKBAR_PINNING_IN_DESKTOP_MODE
|
||||
import com.android.launcher3.dagger.LauncherAppComponent
|
||||
import com.android.launcher3.dagger.LauncherAppSingleton
|
||||
import com.android.launcher3.util.DisplayController.CHANGE_DENSITY
|
||||
import com.android.launcher3.util.DisplayController.CHANGE_DESKTOP_MODE
|
||||
import com.android.launcher3.util.DisplayController.CHANGE_ROTATION
|
||||
import com.android.launcher3.util.DisplayController.CHANGE_SHOW_LOCKED_TASKBAR
|
||||
import com.android.launcher3.util.DisplayController.CHANGE_TASKBAR_PINNING
|
||||
@@ -105,7 +103,6 @@ class DisplayControllerTest {
|
||||
displayManager = context.spyService(DisplayManager::class.java)
|
||||
|
||||
whenever(launcherPrefs.get(TASKBAR_PINNING)).thenReturn(false)
|
||||
whenever(launcherPrefs.get(TASKBAR_PINNING_IN_DESKTOP_MODE)).thenReturn(true)
|
||||
|
||||
// Mock WindowManagerProxy
|
||||
val displayInfo = CachedDisplayInfo(Point(width, height), Surface.ROTATION_0)
|
||||
@@ -189,15 +186,6 @@ class DisplayControllerTest {
|
||||
.onDisplayInfoChanged(any(), any(), eq(CHANGE_TASKBAR_PINNING))
|
||||
}
|
||||
|
||||
@Test
|
||||
@UiThreadTest
|
||||
fun testTaskbarPinningChangeInDesktopMode() {
|
||||
whenever(launcherPrefs.get(TASKBAR_PINNING_IN_DESKTOP_MODE)).thenReturn(false)
|
||||
displayController.notifyConfigChange()
|
||||
verify(displayInfoChangeListener)
|
||||
.onDisplayInfoChanged(any(), any(), eq(CHANGE_TASKBAR_PINNING))
|
||||
}
|
||||
|
||||
@Test
|
||||
@UiThreadTest
|
||||
fun testTaskbarPinningChangeInLockedTaskbarChange() {
|
||||
@@ -239,63 +227,6 @@ class DisplayControllerTest {
|
||||
)
|
||||
assertFalse(displayController.getInfo().isTransientTaskbar())
|
||||
}
|
||||
|
||||
@Test
|
||||
@UiThreadTest
|
||||
fun testTaskbarPinnedForDesktopTaskbar_inDesktopMode() {
|
||||
whenever(windowManagerProxy.showDesktopTaskbarForFreeformDisplay(any())).thenReturn(true)
|
||||
whenever(launcherPrefs.get(TASKBAR_PINNING)).thenReturn(false)
|
||||
whenever(launcherPrefs.get(TASKBAR_PINNING_IN_DESKTOP_MODE)).thenReturn(false)
|
||||
whenever(windowManagerProxy.isInDesktopMode(any())).thenReturn(true)
|
||||
whenever(windowManagerProxy.isHomeVisible()).thenReturn(false)
|
||||
DisplayController.enableTaskbarModePreferenceForTests(true)
|
||||
|
||||
assertTrue(displayController.getInfo().isTransientTaskbar())
|
||||
|
||||
displayController.onConfigurationChanged(configuration)
|
||||
|
||||
verify(displayInfoChangeListener)
|
||||
.onDisplayInfoChanged(any(), any(), eq(CHANGE_TASKBAR_PINNING or CHANGE_DESKTOP_MODE))
|
||||
assertFalse(displayController.getInfo().isTransientTaskbar())
|
||||
}
|
||||
|
||||
@Test
|
||||
@UiThreadTest
|
||||
fun testTaskbarPinnedForDesktopTaskbar_notInDesktopMode() {
|
||||
whenever(windowManagerProxy.showDesktopTaskbarForFreeformDisplay(any())).thenReturn(true)
|
||||
whenever(launcherPrefs.get(TASKBAR_PINNING)).thenReturn(false)
|
||||
whenever(launcherPrefs.get(TASKBAR_PINNING_IN_DESKTOP_MODE)).thenReturn(false)
|
||||
whenever(windowManagerProxy.isInDesktopMode(any())).thenReturn(false)
|
||||
whenever(windowManagerProxy.isHomeVisible()).thenReturn(false)
|
||||
DisplayController.enableTaskbarModePreferenceForTests(true)
|
||||
|
||||
assertTrue(displayController.getInfo().isTransientTaskbar())
|
||||
|
||||
displayController.onConfigurationChanged(configuration)
|
||||
|
||||
verify(displayInfoChangeListener)
|
||||
.onDisplayInfoChanged(any(), any(), eq(CHANGE_TASKBAR_PINNING))
|
||||
assertFalse(displayController.getInfo().isTransientTaskbar())
|
||||
}
|
||||
|
||||
@Test
|
||||
@UiThreadTest
|
||||
fun testTaskbarPinnedForDesktopTaskbar_onHome() {
|
||||
whenever(windowManagerProxy.showDesktopTaskbarForFreeformDisplay(any())).thenReturn(true)
|
||||
whenever(launcherPrefs.get(TASKBAR_PINNING)).thenReturn(false)
|
||||
whenever(launcherPrefs.get(TASKBAR_PINNING_IN_DESKTOP_MODE)).thenReturn(false)
|
||||
whenever(windowManagerProxy.isInDesktopMode(any())).thenReturn(false)
|
||||
whenever(windowManagerProxy.isHomeVisible()).thenReturn(true)
|
||||
DisplayController.enableTaskbarModePreferenceForTests(true)
|
||||
|
||||
assertTrue(displayController.getInfo().isTransientTaskbar())
|
||||
|
||||
displayController.onConfigurationChanged(configuration)
|
||||
|
||||
verify(displayInfoChangeListener)
|
||||
.onDisplayInfoChanged(any(), any(), eq(CHANGE_TASKBAR_PINNING))
|
||||
assertFalse(displayController.getInfo().isTransientTaskbar())
|
||||
}
|
||||
}
|
||||
|
||||
class MyWmProxy : WindowManagerProxy()
|
||||
|
||||
Reference in new issue
Block a user