diff options
| author | 2024-09-13 15:29:26 -0700 | |
|---|---|---|
| committer | 2024-09-13 22:42:42 +0000 | |
| commit | cd2ee6d88da6bf2e7c47333f8fce5aba8711422c (patch) | |
| tree | ba77b8fa35f46e5778abd304d612e2c6b762db7f | |
| parent | 2ca7c59b8de3ff9ab7a3ae084409e890878c0918 (diff) | |
[Desktop Windowing] Rename Additional Windows Above Status Bar flag.
Renames the flag to "Enable Handle Input Fix" to better describe the
use of the flag, that being to fix input issues in the handle area. Also labels it as a bugfix flag.
Bug: 316186265
Test: m
Flag: NONE, renaming a flag
Change-Id: I7abafcdeca5d4c668d893b069c291d277e5b0359
9 files changed, 31 insertions, 28 deletions
diff --git a/core/java/android/window/flags/lse_desktop_experience.aconfig b/core/java/android/window/flags/lse_desktop_experience.aconfig index 6e89c497cbac..ca96460afb29 100644 --- a/core/java/android/window/flags/lse_desktop_experience.aconfig +++ b/core/java/android/window/flags/lse_desktop_experience.aconfig @@ -86,10 +86,13 @@ flag { } flag { - name: "enable_additional_windows_above_status_bar" + name: "enable_handle_input_fix" namespace: "lse_desktop_experience" - description: "Allows for additional windows tied to WindowDecoration to be layered between status bar and notification shade." + description: "Enables using AdditionalSystemViewContainer to resolve handle input issues." bug: "316186265" + metadata { + purpose: PURPOSE_BUGFIX + } } flag { diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java index a0047da46d60..3812ddc93ce9 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java @@ -405,7 +405,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { final RunningTaskInfo oldTaskInfo = decoration.mTaskInfo; if (taskInfo.displayId != oldTaskInfo.displayId - && !Flags.enableAdditionalWindowsAboveStatusBar()) { + && !Flags.enableHandleInputFix()) { removeTaskFromEventReceiver(oldTaskInfo.displayId); incrementEventReceiverTasks(taskInfo.displayId); } @@ -472,7 +472,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { decoration.close(); final int displayId = taskInfo.displayId; if (mEventReceiversByDisplay.contains(displayId) - && !Flags.enableAdditionalWindowsAboveStatusBar()) { + && !Flags.enableHandleInputFix()) { removeTaskFromEventReceiver(displayId); } // Remove the decoration from the cache last because WindowDecoration#close could still @@ -1032,7 +1032,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { relevantDecor.updateHoverAndPressStatus(ev); final int action = ev.getActionMasked(); if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { - if (!mTransitionDragActive && !Flags.enableAdditionalWindowsAboveStatusBar()) { + if (!mTransitionDragActive && !Flags.enableHandleInputFix()) { relevantDecor.closeHandleMenuIfNeeded(ev); } } @@ -1075,7 +1075,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { } final boolean shouldStartTransitionDrag = relevantDecor.checkTouchEventInFocusedCaptionHandle(ev) - || Flags.enableAdditionalWindowsAboveStatusBar(); + || Flags.enableHandleInputFix(); if (dragFromStatusBarAllowed && shouldStartTransitionDrag) { mTransitionDragActive = true; } @@ -1342,7 +1342,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { windowDecoration.setDragDetector(touchEventListener.mDragDetector); windowDecoration.relayout(taskInfo, startT, finishT, false /* applyStartTransactionOnDraw */, false /* shouldSetTaskPositionAndCrop */); - if (!Flags.enableAdditionalWindowsAboveStatusBar()) { + if (!Flags.enableHandleInputFix()) { incrementEventReceiverTasks(taskInfo.displayId); } } @@ -1475,7 +1475,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { && Flags.enableDesktopWindowingImmersiveHandleHiding()) { decor.onInsetsStateChanged(insetsState); } - if (!Flags.enableAdditionalWindowsAboveStatusBar()) { + if (!Flags.enableHandleInputFix()) { // If status bar inset is visible, top task is not in immersive mode. // This value is only needed when the App Handle input is being handled // through the global input monitor (hence the flag check) to ignore gestures diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java index 1409d3011395..6fcbc65ff64c 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java @@ -516,7 +516,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin */ void disposeStatusBarInputLayer() { if (!isAppHandle(mWindowDecorViewHolder) - || !Flags.enableAdditionalWindowsAboveStatusBar()) { + || !Flags.enableHandleInputFix()) { return; } ((AppHandleViewHolder) mWindowDecorViewHolder).disposeStatusBarInputLayer(); @@ -612,7 +612,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin } controlsElement.mAlignment = RelayoutParams.OccludingCaptionElement.Alignment.END; relayoutParams.mOccludingCaptionElements.add(controlsElement); - } else if (isAppHandle && !Flags.enableAdditionalWindowsAboveStatusBar()) { + } else if (isAppHandle && !Flags.enableHandleInputFix()) { // The focused decor (fullscreen/split) does not need to handle input because input in // the App Handle is handled by the InputMonitor in DesktopModeWindowDecorViewModel. // Note: This does not apply with the above flag enabled as the status bar input layer @@ -1093,13 +1093,13 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin */ boolean checkTouchEventInFocusedCaptionHandle(MotionEvent ev) { if (isHandleMenuActive() || !isAppHandle(mWindowDecorViewHolder) - || Flags.enableAdditionalWindowsAboveStatusBar()) { + || Flags.enableHandleInputFix()) { return false; } // The status bar input layer can only receive input in handle coordinates to begin with, // so checking coordinates is unnecessary as input is always within handle bounds. if (isAppHandle(mWindowDecorViewHolder) - && Flags.enableAdditionalWindowsAboveStatusBar() + && Flags.enableHandleInputFix() && isCaptionVisible()) { return true; } @@ -1136,7 +1136,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin * @param ev the MotionEvent to compare */ void checkTouchEvent(MotionEvent ev) { - if (mResult.mRootView == null || Flags.enableAdditionalWindowsAboveStatusBar()) return; + if (mResult.mRootView == null || Flags.enableHandleInputFix()) return; final View caption = mResult.mRootView.findViewById(R.id.desktop_mode_caption); final View handle = caption.findViewById(R.id.caption_handle); final boolean inHandle = !isHandleMenuActive() @@ -1149,7 +1149,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin // If the whole handle menu can be touched directly, rely on FLAG_WATCH_OUTSIDE_TOUCH. // This is for the case that some of the handle menu is underneath the status bar. if (isAppHandle(mWindowDecorViewHolder) - && !Flags.enableAdditionalWindowsAboveStatusBar()) { + && !Flags.enableHandleInputFix()) { mHandleMenu.checkMotionEvent(ev); closeHandleMenuIfNeeded(ev); } @@ -1163,7 +1163,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin * @param ev the MotionEvent to compare against. */ void updateHoverAndPressStatus(MotionEvent ev) { - if (mResult.mRootView == null || Flags.enableAdditionalWindowsAboveStatusBar()) return; + if (mResult.mRootView == null || Flags.enableHandleInputFix()) return; final View handle = mResult.mRootView.findViewById(R.id.caption_handle); final boolean inHandle = !isHandleMenuActive() && checkTouchEventInFocusedCaptionHandle(ev); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.kt index 748046ebd08d..d1767ac69a6d 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.kt @@ -80,7 +80,7 @@ class HandleMenu( private val taskInfo: RunningTaskInfo = parentDecor.mTaskInfo private val isViewAboveStatusBar: Boolean - get() = (Flags.enableAdditionalWindowsAboveStatusBar() && !taskInfo.isFreeform) + get() = (Flags.enableHandleInputFix() && !taskInfo.isFreeform) private val pillElevation: Int = loadDimensionPixelSize( R.dimen.desktop_mode_handle_menu_pill_elevation) @@ -177,7 +177,7 @@ class HandleMenu( val x = handleMenuPosition.x.toInt() val y = handleMenuPosition.y.toInt() handleMenuViewContainer = - if (!taskInfo.isFreeform && Flags.enableAdditionalWindowsAboveStatusBar()) { + if (!taskInfo.isFreeform && Flags.enableHandleInputFix()) { AdditionalSystemViewContainer( windowManagerWrapper = windowManagerWrapper, taskId = taskInfo.taskId, @@ -212,7 +212,7 @@ class HandleMenu( menuX = marginMenuStart menuY = marginMenuTop } else { - if (Flags.enableAdditionalWindowsAboveStatusBar()) { + if (Flags.enableHandleInputFix()) { // In a focused decor, we use global coordinates for handle menu. Therefore we // need to account for other factors like split stage and menu/handle width to // center the menu. diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenuImageButton.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenuImageButton.kt index 18757ef6ff40..cf82bb4f9919 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenuImageButton.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenuImageButton.kt @@ -39,7 +39,7 @@ class HandleMenuImageButton( lateinit var taskInfo: RunningTaskInfo override fun onHoverEvent(motionEvent: MotionEvent): Boolean { - if (Flags.enableAdditionalWindowsAboveStatusBar() || taskInfo.isFreeform) { + if (Flags.enableHandleInputFix() || taskInfo.isFreeform) { return super.onHoverEvent(motionEvent) } else { return false diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHandleViewHolder.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHandleViewHolder.kt index 9ef4b8cde8ef..1c11a8dfbbb4 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHandleViewHolder.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHandleViewHolder.kt @@ -100,7 +100,7 @@ internal class AppHandleViewHolder( private fun createStatusBarInputLayer(handlePosition: Point, handleWidth: Int, handleHeight: Int) { - if (!Flags.enableAdditionalWindowsAboveStatusBar()) return + if (!Flags.enableHandleInputFix()) return statusBarInputLayer = AdditionalSystemViewContainer(context, windowManagerWrapper, taskInfo.taskId, handlePosition.x, handlePosition.y, handleWidth, handleHeight, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTests.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTests.kt index a17d08d8fbfb..a18fbf0891ef 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTests.kt +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTests.kt @@ -316,7 +316,7 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() { } @Test - @DisableFlags(Flags.FLAG_ENABLE_ADDITIONAL_WINDOWS_ABOVE_STATUS_BAR) + @DisableFlags(Flags.FLAG_ENABLE_HANDLE_INPUT_FIX) fun testCreateAndDisposeEventReceiver() { val decor = createOpenTaskDecoration(windowingMode = WINDOWING_MODE_FREEFORM) desktopModeWindowDecorViewModel.destroyWindowDecoration(decor.mTaskInfo) @@ -326,7 +326,7 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() { } @Test - @DisableFlags(Flags.FLAG_ENABLE_ADDITIONAL_WINDOWS_ABOVE_STATUS_BAR) + @DisableFlags(Flags.FLAG_ENABLE_HANDLE_INPUT_FIX) fun testEventReceiversOnMultipleDisplays() { val secondaryDisplay = createVirtualDisplay() ?: return val secondaryDisplayId = secondaryDisplay.display.displayId diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java index 7b68ddf64fce..33c7cf013c6f 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java @@ -404,7 +404,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { } @Test - @DisableFlags(Flags.FLAG_ENABLE_ADDITIONAL_WINDOWS_ABOVE_STATUS_BAR) + @DisableFlags(Flags.FLAG_ENABLE_HANDLE_INPUT_FIX) public void updateRelayoutParams_fullscreen_inputChannelNotNeeded() { final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(/* visible= */ true); taskInfo.configuration.windowConfiguration.setWindowingMode(WINDOWING_MODE_FULLSCREEN); @@ -421,7 +421,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { } @Test - @DisableFlags(Flags.FLAG_ENABLE_ADDITIONAL_WINDOWS_ABOVE_STATUS_BAR) + @DisableFlags(Flags.FLAG_ENABLE_HANDLE_INPUT_FIX) public void updateRelayoutParams_multiwindow_inputChannelNotNeeded() { final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(/* visible= */ true); taskInfo.configuration.windowConfiguration.setWindowingMode(WINDOWING_MODE_MULTI_WINDOW); diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/HandleMenuTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/HandleMenuTest.kt index 100abbbb8332..b2423e25cd9d 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/HandleMenuTest.kt +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/HandleMenuTest.kt @@ -134,7 +134,7 @@ class HandleMenuTest : ShellTestCase() { } @Test - @EnableFlags(Flags.FLAG_ENABLE_ADDITIONAL_WINDOWS_ABOVE_STATUS_BAR) + @EnableFlags(Flags.FLAG_ENABLE_HANDLE_INPUT_FIX) fun testFullscreenMenuUsesSystemViewContainer() { createTaskInfo(WINDOWING_MODE_FULLSCREEN, SPLIT_POSITION_UNDEFINED) val handleMenu = createAndShowHandleMenu(SPLIT_POSITION_UNDEFINED) @@ -146,7 +146,7 @@ class HandleMenuTest : ShellTestCase() { } @Test - @EnableFlags(Flags.FLAG_ENABLE_ADDITIONAL_WINDOWS_ABOVE_STATUS_BAR) + @EnableFlags(Flags.FLAG_ENABLE_HANDLE_INPUT_FIX) fun testFreeformMenu_usesViewHostViewContainer() { createTaskInfo(WINDOWING_MODE_FREEFORM, SPLIT_POSITION_UNDEFINED) handleMenu = createAndShowHandleMenu(SPLIT_POSITION_UNDEFINED) @@ -157,7 +157,7 @@ class HandleMenuTest : ShellTestCase() { } @Test - @EnableFlags(Flags.FLAG_ENABLE_ADDITIONAL_WINDOWS_ABOVE_STATUS_BAR) + @EnableFlags(Flags.FLAG_ENABLE_HANDLE_INPUT_FIX) fun testSplitLeftMenu_usesSystemViewContainer() { createTaskInfo(WINDOWING_MODE_MULTI_WINDOW, SPLIT_POSITION_TOP_OR_LEFT) handleMenu = createAndShowHandleMenu(SPLIT_POSITION_TOP_OR_LEFT) @@ -172,7 +172,7 @@ class HandleMenuTest : ShellTestCase() { } @Test - @EnableFlags(Flags.FLAG_ENABLE_ADDITIONAL_WINDOWS_ABOVE_STATUS_BAR) + @EnableFlags(Flags.FLAG_ENABLE_HANDLE_INPUT_FIX) fun testSplitRightMenu_usesSystemViewContainer() { createTaskInfo(WINDOWING_MODE_MULTI_WINDOW, SPLIT_POSITION_BOTTOM_OR_RIGHT) handleMenu = createAndShowHandleMenu(SPLIT_POSITION_BOTTOM_OR_RIGHT) |