Loading core/java/android/window/flags/lse_desktop_experience.aconfig +5 −2 Original line number Diff line number Diff line Loading @@ -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 { Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +6 −6 Original line number Diff line number Diff line Loading @@ -413,7 +413,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); } Loading Loading @@ -480,7 +480,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 Loading Loading @@ -1096,7 +1096,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); } } Loading Loading @@ -1139,7 +1139,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { } final boolean shouldStartTransitionDrag = relevantDecor.checkTouchEventInFocusedCaptionHandle(ev) || Flags.enableAdditionalWindowsAboveStatusBar(); || Flags.enableHandleInputFix(); if (dragFromStatusBarAllowed && shouldStartTransitionDrag) { mTransitionDragActive = true; } Loading Loading @@ -1424,7 +1424,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); } } Loading Loading @@ -1580,7 +1580,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 Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +7 −7 Original line number Diff line number Diff line Loading @@ -536,7 +536,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin */ void disposeStatusBarInputLayer() { if (!isAppHandle(mWindowDecorViewHolder) || !Flags.enableAdditionalWindowsAboveStatusBar()) { || !Flags.enableHandleInputFix()) { return; } ((AppHandleViewHolder) mWindowDecorViewHolder).disposeStatusBarInputLayer(); Loading Loading @@ -632,7 +632,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 Loading Loading @@ -1157,13 +1157,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; } Loading Loading @@ -1200,7 +1200,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() Loading @@ -1213,7 +1213,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); } Loading @@ -1227,7 +1227,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); Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.kt +3 −3 Original line number Diff line number Diff line Loading @@ -81,7 +81,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) Loading Loading @@ -183,7 +183,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, Loading Loading @@ -218,7 +218,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. Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenuImageButton.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
core/java/android/window/flags/lse_desktop_experience.aconfig +5 −2 Original line number Diff line number Diff line Loading @@ -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 { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +6 −6 Original line number Diff line number Diff line Loading @@ -413,7 +413,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); } Loading Loading @@ -480,7 +480,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 Loading Loading @@ -1096,7 +1096,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); } } Loading Loading @@ -1139,7 +1139,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { } final boolean shouldStartTransitionDrag = relevantDecor.checkTouchEventInFocusedCaptionHandle(ev) || Flags.enableAdditionalWindowsAboveStatusBar(); || Flags.enableHandleInputFix(); if (dragFromStatusBarAllowed && shouldStartTransitionDrag) { mTransitionDragActive = true; } Loading Loading @@ -1424,7 +1424,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); } } Loading Loading @@ -1580,7 +1580,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 Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +7 −7 Original line number Diff line number Diff line Loading @@ -536,7 +536,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin */ void disposeStatusBarInputLayer() { if (!isAppHandle(mWindowDecorViewHolder) || !Flags.enableAdditionalWindowsAboveStatusBar()) { || !Flags.enableHandleInputFix()) { return; } ((AppHandleViewHolder) mWindowDecorViewHolder).disposeStatusBarInputLayer(); Loading Loading @@ -632,7 +632,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 Loading Loading @@ -1157,13 +1157,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; } Loading Loading @@ -1200,7 +1200,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() Loading @@ -1213,7 +1213,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); } Loading @@ -1227,7 +1227,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); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.kt +3 −3 Original line number Diff line number Diff line Loading @@ -81,7 +81,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) Loading Loading @@ -183,7 +183,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, Loading Loading @@ -218,7 +218,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. Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenuImageButton.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading