summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ats Jenk <atsjenk@google.com> 2025-03-20 12:39:12 -0700
committer Ats Jenk <atsjenk@google.com> 2025-03-20 12:43:17 -0700
commita08f3525af15601668382423a314021ee712a778 (patch)
treea4d68f965b277c63dbb17e8e8b7c0ecb0dc1a431
parent34f9f07edf00f62d54803c60a5c30af678e33195 (diff)
Limit app handle from bubbles to fullscreen apps
When we enable app handle due to bubble anything feature, keep it for fullscreen apps only. Bug: 404919014 Test: check that only fullscreen apps show the handle Flag: com.android.wm.shell.enable_bubble_to_fullscreen Change-Id: I75817a7f683ff5a343afacad7f4d1a6418c439a6
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/common/AppHandleAndHeaderVisibilityHelper.kt15
1 files changed, 12 insertions, 3 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/common/AppHandleAndHeaderVisibilityHelper.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/common/AppHandleAndHeaderVisibilityHelper.kt
index 39ccf5bd03a7..950eeccf6a4a 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/common/AppHandleAndHeaderVisibilityHelper.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/common/AppHandleAndHeaderVisibilityHelper.kt
@@ -23,6 +23,7 @@ import android.view.WindowManager
import android.window.DesktopExperienceFlags.ENABLE_BUG_FIXES_FOR_SECONDARY_DISPLAY
import com.android.wm.shell.common.DisplayController
import com.android.wm.shell.desktopmode.DesktopWallpaperActivity.Companion.isWallpaperTask
+import com.android.wm.shell.shared.bubbles.BubbleAnythingFlagHelper
import com.android.wm.shell.shared.desktopmode.DesktopModeCompatPolicy
import com.android.wm.shell.shared.desktopmode.DesktopModeStatus
import com.android.wm.shell.splitscreen.SplitScreenController
@@ -52,7 +53,8 @@ class AppHandleAndHeaderVisibilityHelper (
private fun allowedForTask(taskInfo: ActivityManager.RunningTaskInfo): Boolean {
// TODO (b/382023296): Remove once we no longer rely on
// Flags.enableBugFixesForSecondaryDisplay as it is taken care of in #allowedForDisplay
- if (displayController.getDisplay(taskInfo.displayId) == null) {
+ val display = displayController.getDisplay(taskInfo.displayId)
+ if (display == null) {
// If DisplayController doesn't have it tracked, it could be a private/managed display.
return false
}
@@ -68,8 +70,7 @@ class AppHandleAndHeaderVisibilityHelper (
// TODO (b/382023296): Remove once we no longer rely on
// Flags.enableBugFixesForSecondaryDisplay as it is taken care of in #allowedForDisplay
val isOnLargeScreen =
- displayController.getDisplay(taskInfo.displayId).minSizeDimensionDp >=
- WindowManager.LARGE_SCREEN_SMALLEST_SCREEN_WIDTH_DP
+ display.minSizeDimensionDp >= WindowManager.LARGE_SCREEN_SMALLEST_SCREEN_WIDTH_DP
if (!DesktopModeStatus.canEnterDesktopMode(context)
&& DesktopModeStatus.overridesShowAppHandle(context)
&& !isOnLargeScreen
@@ -78,6 +79,14 @@ class AppHandleAndHeaderVisibilityHelper (
// small screens
return false
}
+ if (BubbleAnythingFlagHelper.enableBubbleToFullscreen()
+ && !DesktopModeStatus.isDesktopModeSupportedOnDisplay(context, display)
+ ) {
+ // TODO(b/388853233): enable handles for split tasks once drag to bubble is enabled
+ if (taskInfo.windowingMode != WindowConfiguration.WINDOWING_MODE_FULLSCREEN) {
+ return false
+ }
+ }
return DesktopModeStatus.canEnterDesktopModeOrShowAppHandle(context)
&& !isWallpaperTask(taskInfo)
&& taskInfo.windowingMode != WindowConfiguration.WINDOWING_MODE_PINNED