Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +3 −0 Original line number Diff line number Diff line Loading @@ -1745,6 +1745,9 @@ class DesktopTasksController( launchWindowingMode = WINDOWING_MODE_FULLSCREEN pendingIntentBackgroundActivityStartMode = ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS if (Flags.enablePerDisplayDesktopWallpaperActivity()) { launchDisplayId = displayId } } val pendingIntent = PendingIntent.getActivityAsUser( Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +17 −0 Original line number Diff line number Diff line Loading @@ -2809,6 +2809,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() // Should launch home wct.assertPendingIntentAt(0, launchHomeIntent(DEFAULT_DISPLAY)) wct.assertPendingIntentActivityOptionsLaunchDisplayIdAt(0, DEFAULT_DISPLAY) } @Test Loading Loading @@ -3931,6 +3932,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() // Should launch home assertNotNull(result, "Should handle request") .assertPendingIntentAt(0, launchHomeIntent(DEFAULT_DISPLAY)) result!!.assertPendingIntentActivityOptionsLaunchDisplayIdAt(0, DEFAULT_DISPLAY) } @Test Loading @@ -3957,6 +3959,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() // Should launch home assertNotNull(result, "Should handle request") .assertPendingIntentAt(0, launchHomeIntent(DEFAULT_DISPLAY)) result!!.assertPendingIntentActivityOptionsLaunchDisplayIdAt(0, DEFAULT_DISPLAY) } @Test Loading Loading @@ -4089,6 +4092,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() // Should launch home assertNotNull(result, "Should handle request") .assertPendingIntentAt(0, launchHomeIntent(DEFAULT_DISPLAY)) result!!.assertPendingIntentActivityOptionsLaunchDisplayIdAt(0, DEFAULT_DISPLAY) } @Test Loading @@ -4105,6 +4109,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() // Should launch home assertNotNull(result, "Should handle request") .assertPendingIntentAt(0, launchHomeIntent(SECOND_DISPLAY)) result!!.assertPendingIntentActivityOptionsLaunchDisplayIdAt(0, SECOND_DISPLAY) } @Test Loading Loading @@ -6898,6 +6903,18 @@ private fun WindowContainerTransaction.assertPendingIntentAt(index: Int, intent: assertThat(op.pendingIntent?.intent?.categories).isEqualTo(intent.categories) } private fun WindowContainerTransaction.assertPendingIntentActivityOptionsLaunchDisplayIdAt( index: Int, displayId: Int, ) { assertIndexInBounds(index) val op = hierarchyOps[index] if (op.launchOptions != null) { val options = ActivityOptions(op.launchOptions) assertThat(options.launchDisplayId).isEqualTo(displayId) } } private fun WindowContainerTransaction.assertLaunchTask(taskId: Int, windowingMode: Int) { val keyLaunchWindowingMode = "android.activity.windowingMode" Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +3 −0 Original line number Diff line number Diff line Loading @@ -1745,6 +1745,9 @@ class DesktopTasksController( launchWindowingMode = WINDOWING_MODE_FULLSCREEN pendingIntentBackgroundActivityStartMode = ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS if (Flags.enablePerDisplayDesktopWallpaperActivity()) { launchDisplayId = displayId } } val pendingIntent = PendingIntent.getActivityAsUser( Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +17 −0 Original line number Diff line number Diff line Loading @@ -2809,6 +2809,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() // Should launch home wct.assertPendingIntentAt(0, launchHomeIntent(DEFAULT_DISPLAY)) wct.assertPendingIntentActivityOptionsLaunchDisplayIdAt(0, DEFAULT_DISPLAY) } @Test Loading Loading @@ -3931,6 +3932,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() // Should launch home assertNotNull(result, "Should handle request") .assertPendingIntentAt(0, launchHomeIntent(DEFAULT_DISPLAY)) result!!.assertPendingIntentActivityOptionsLaunchDisplayIdAt(0, DEFAULT_DISPLAY) } @Test Loading @@ -3957,6 +3959,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() // Should launch home assertNotNull(result, "Should handle request") .assertPendingIntentAt(0, launchHomeIntent(DEFAULT_DISPLAY)) result!!.assertPendingIntentActivityOptionsLaunchDisplayIdAt(0, DEFAULT_DISPLAY) } @Test Loading Loading @@ -4089,6 +4092,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() // Should launch home assertNotNull(result, "Should handle request") .assertPendingIntentAt(0, launchHomeIntent(DEFAULT_DISPLAY)) result!!.assertPendingIntentActivityOptionsLaunchDisplayIdAt(0, DEFAULT_DISPLAY) } @Test Loading @@ -4105,6 +4109,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() // Should launch home assertNotNull(result, "Should handle request") .assertPendingIntentAt(0, launchHomeIntent(SECOND_DISPLAY)) result!!.assertPendingIntentActivityOptionsLaunchDisplayIdAt(0, SECOND_DISPLAY) } @Test Loading Loading @@ -6898,6 +6903,18 @@ private fun WindowContainerTransaction.assertPendingIntentAt(index: Int, intent: assertThat(op.pendingIntent?.intent?.categories).isEqualTo(intent.categories) } private fun WindowContainerTransaction.assertPendingIntentActivityOptionsLaunchDisplayIdAt( index: Int, displayId: Int, ) { assertIndexInBounds(index) val op = hierarchyOps[index] if (op.launchOptions != null) { val options = ActivityOptions(op.launchOptions) assertThat(options.launchDisplayId).isEqualTo(displayId) } } private fun WindowContainerTransaction.assertLaunchTask(taskId: Int, windowingMode: Int) { val keyLaunchWindowingMode = "android.activity.windowingMode" Loading