Merge "Relayer taskbar to application_overlay when shade is opened" into main
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
index b44bb23..018903e 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
@@ -320,6 +320,7 @@
         if (BubbleBarController.isBubbleBarEnabled()
                 && deviceBubbleBarEnabled
                 && bubbleBarView != null
+                && isPrimaryDisplay
         ) {
             Optional<BubbleStashedHandleViewController> bubbleHandleController = Optional.empty();
             Optional<BubbleBarSwipeController> bubbleBarSwipeController = Optional.empty();
diff --git a/quickstep/src/com/android/quickstep/util/DesksUtils.kt b/quickstep/src/com/android/quickstep/util/DesksUtils.kt
index a10f771..521ba27 100644
--- a/quickstep/src/com/android/quickstep/util/DesksUtils.kt
+++ b/quickstep/src/com/android/quickstep/util/DesksUtils.kt
@@ -19,7 +19,6 @@
 import android.app.TaskInfo
 import android.content.ComponentName
 import android.content.res.Resources
-import android.util.Log
 import android.window.DesktopExperienceFlags
 import com.android.systemui.shared.recents.model.Task
 
@@ -40,7 +39,9 @@
 
         @JvmStatic
         fun isDesktopWallpaperTask(taskInfo: TaskInfo): Boolean {
-            Log.d("b/403118101", "isDesktopWallpaperTask: $taskInfo")
+            // TODO: b/403118101 - In some launcher tests, there is a task with baseIntent set to
+            // null. Remove this check after finding out how that task is created.
+            if (taskInfo.baseIntent == null) return false
             return taskInfo.baseIntent.component?.let(::isDesktopWallpaperComponent) == true
         }
 
diff --git a/quickstep/tests/src/com/android/quickstep/DesktopSystemShortcutTest.kt b/quickstep/tests/src/com/android/quickstep/DesktopSystemShortcutTest.kt
index 7b73be7..746f8bb 100644
--- a/quickstep/tests/src/com/android/quickstep/DesktopSystemShortcutTest.kt
+++ b/quickstep/tests/src/com/android/quickstep/DesktopSystemShortcutTest.kt
@@ -22,6 +22,7 @@
 import android.content.pm.PackageManager
 import android.platform.test.annotations.DisableFlags
 import android.platform.test.annotations.EnableFlags
+import android.platform.test.flag.junit.SetFlagsRule
 import android.view.Display.DEFAULT_DISPLAY
 import androidx.test.platform.app.InstrumentationRegistry
 import com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession
@@ -52,6 +53,7 @@
 import com.google.common.truth.Truth.assertThat
 import org.junit.After
 import org.junit.Before
+import org.junit.Rule
 import org.junit.Test
 import org.mockito.Mockito.`when`
 import org.mockito.kotlin.any
@@ -64,8 +66,11 @@
 import org.mockito.quality.Strictness
 
 /** Test for [DesktopSystemShortcut] */
+// TODO(b/403558856): Improve test coverage for DesktopModeCompatPolicy integration.
 class DesktopSystemShortcutTest {
 
+    @get:Rule val setFlagsRule = SetFlagsRule(SetFlagsRule.DefaultInitValueType.DEVICE_DEFAULT)
+
     private val launcher: RecentsViewContainer = mock()
     private val statsLogManager: StatsLogManager = mock()
     private val statsLogger: StatsLogManager.StatsLogger = mock()