Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DefaultWindowDecoration.kt +7 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import android.view.View.OnLongClickListener import android.view.View.OnTouchListener import android.view.ViewConfiguration import android.view.WindowManager import android.view.WindowManager.LayoutParams.INPUT_FEATURE_SPY import android.view.WindowManager.TRANSIT_CHANGE import android.view.WindowManagerGlobal import android.window.DesktopExperienceFlags Loading Loading @@ -469,6 +470,12 @@ constructor( } inputFeatures = inputFeatures or WindowManager.LayoutParams.INPUT_FEATURE_DISPLAY_TOPOLOGY_AWARE } else if ( isAppHandle && DesktopExperienceFlags.ENABLE_REMOVE_STATUS_BAR_INPUT_LAYER.isTrue ) { // Add input feature spy flag if caption is an app handle so that input is not stolen // when motion event exits caption view. inputFeatures = inputFeatures or INPUT_FEATURE_SPY } // The configuration used to layout the window decoration. A copy is made instead of using Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeTouchEventListener.java +8 −7 Original line number Diff line number Diff line Loading @@ -331,13 +331,8 @@ public class DesktopModeTouchEventListener viewName, mIsCustomHeaderGesture, mIsResizeGesture); return false; } if (mInputManager != null) { ViewRootImpl viewRootImpl = v.getViewRootImpl(); if (viewRootImpl != null) { // Pilfer so that windows below receive cancellations for this gesture. mInputManager.pilferPointers(viewRootImpl.getInputToken()); } } pilferPointers(v); if (isUpOrCancel) { // Gesture is finished, reset state. mIsCustomHeaderGesture = false; Loading @@ -350,6 +345,12 @@ public class DesktopModeTouchEventListener } } private void pilferPointers(@NonNull View v) { final ViewRootImpl viewRootImpl = v.getViewRootImpl(); if (mInputManager == null || viewRootImpl == null) return; mInputManager.pilferPointers(viewRootImpl.getInputToken()); } @Override public boolean onLongClick(View v) { final String viewName = getResourceName(v); Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +15 −7 Original line number Diff line number Diff line Loading @@ -1206,14 +1206,22 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin } relayoutParams.mInputFeatures |= WindowManager.LayoutParams.INPUT_FEATURE_DISPLAY_TOPOLOGY_AWARE; } else if (isAppHandle && !DesktopModeFlags.ENABLE_HANDLE_INPUT_FIX.isTrue()) { // 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 // will forward events to the handle directly. } else if (isAppHandle) { if (!DesktopModeFlags.ENABLE_HANDLE_INPUT_FIX.isTrue()) { // 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 will forward events to the handle directly. relayoutParams.mInputFeatures |= WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL; } if (DesktopExperienceFlags.ENABLE_REMOVE_STATUS_BAR_INPUT_LAYER.isTrue()) { // Add input feature spy flag if caption is an app handle so that input is not // stolen when motion event exits caption view. relayoutParams.mInputFeatures |= WindowManager.LayoutParams.INPUT_FEATURE_SPY; } } if (isAppHeader && desktopConfig.useWindowShadow(/* isFocusedWindow= */ hasGlobalFocus)) { if (DesktopExperienceFlags.ENABLE_FREEFORM_BOX_SHADOWS.isTrue()) { Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java +14 −1 Original line number Diff line number Diff line Loading @@ -714,7 +714,8 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { } @Test public void updateRelayoutParams_fullscreen_disallowsInputFallthrough() { @DisableFlags(Flags.FLAG_ENABLE_REMOVE_STATUS_BAR_INPUT_LAYER) public void updateRelayoutParams_fullscreenWithStatusBarInputLayer_disallowsInputFallthrough() { final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(/* visible= */ true); taskInfo.configuration.windowConfiguration.setWindowingMode(WINDOWING_MODE_FULLSCREEN); final RelayoutParams relayoutParams = new RelayoutParams(); Loading @@ -724,6 +725,18 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { assertThat(relayoutParams.hasInputFeatureSpy()).isFalse(); } @Test @EnableFlags(Flags.FLAG_ENABLE_REMOVE_STATUS_BAR_INPUT_LAYER) public void updateRelayoutParams_fullscreenWithoutStatusBarInputLayer_isInputFeatureSpy() { final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(/* visible= */ true); taskInfo.configuration.windowConfiguration.setWindowingMode(WINDOWING_MODE_FULLSCREEN); final RelayoutParams relayoutParams = new RelayoutParams(); updateRelayoutParams(relayoutParams, taskInfo); assertThat(relayoutParams.hasInputFeatureSpy()).isTrue(); } @Test @EnableFlags(Flags.FLAG_ENABLE_ACCESSIBLE_CUSTOM_HEADERS) public void updateRelayoutParams_fullscreen_unlimitedTouchRegion() { Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DefaultWindowDecoration.kt +7 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import android.view.View.OnLongClickListener import android.view.View.OnTouchListener import android.view.ViewConfiguration import android.view.WindowManager import android.view.WindowManager.LayoutParams.INPUT_FEATURE_SPY import android.view.WindowManager.TRANSIT_CHANGE import android.view.WindowManagerGlobal import android.window.DesktopExperienceFlags Loading Loading @@ -469,6 +470,12 @@ constructor( } inputFeatures = inputFeatures or WindowManager.LayoutParams.INPUT_FEATURE_DISPLAY_TOPOLOGY_AWARE } else if ( isAppHandle && DesktopExperienceFlags.ENABLE_REMOVE_STATUS_BAR_INPUT_LAYER.isTrue ) { // Add input feature spy flag if caption is an app handle so that input is not stolen // when motion event exits caption view. inputFeatures = inputFeatures or INPUT_FEATURE_SPY } // The configuration used to layout the window decoration. A copy is made instead of using Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeTouchEventListener.java +8 −7 Original line number Diff line number Diff line Loading @@ -331,13 +331,8 @@ public class DesktopModeTouchEventListener viewName, mIsCustomHeaderGesture, mIsResizeGesture); return false; } if (mInputManager != null) { ViewRootImpl viewRootImpl = v.getViewRootImpl(); if (viewRootImpl != null) { // Pilfer so that windows below receive cancellations for this gesture. mInputManager.pilferPointers(viewRootImpl.getInputToken()); } } pilferPointers(v); if (isUpOrCancel) { // Gesture is finished, reset state. mIsCustomHeaderGesture = false; Loading @@ -350,6 +345,12 @@ public class DesktopModeTouchEventListener } } private void pilferPointers(@NonNull View v) { final ViewRootImpl viewRootImpl = v.getViewRootImpl(); if (mInputManager == null || viewRootImpl == null) return; mInputManager.pilferPointers(viewRootImpl.getInputToken()); } @Override public boolean onLongClick(View v) { final String viewName = getResourceName(v); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +15 −7 Original line number Diff line number Diff line Loading @@ -1206,14 +1206,22 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin } relayoutParams.mInputFeatures |= WindowManager.LayoutParams.INPUT_FEATURE_DISPLAY_TOPOLOGY_AWARE; } else if (isAppHandle && !DesktopModeFlags.ENABLE_HANDLE_INPUT_FIX.isTrue()) { // 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 // will forward events to the handle directly. } else if (isAppHandle) { if (!DesktopModeFlags.ENABLE_HANDLE_INPUT_FIX.isTrue()) { // 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 will forward events to the handle directly. relayoutParams.mInputFeatures |= WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL; } if (DesktopExperienceFlags.ENABLE_REMOVE_STATUS_BAR_INPUT_LAYER.isTrue()) { // Add input feature spy flag if caption is an app handle so that input is not // stolen when motion event exits caption view. relayoutParams.mInputFeatures |= WindowManager.LayoutParams.INPUT_FEATURE_SPY; } } if (isAppHeader && desktopConfig.useWindowShadow(/* isFocusedWindow= */ hasGlobalFocus)) { if (DesktopExperienceFlags.ENABLE_FREEFORM_BOX_SHADOWS.isTrue()) { Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java +14 −1 Original line number Diff line number Diff line Loading @@ -714,7 +714,8 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { } @Test public void updateRelayoutParams_fullscreen_disallowsInputFallthrough() { @DisableFlags(Flags.FLAG_ENABLE_REMOVE_STATUS_BAR_INPUT_LAYER) public void updateRelayoutParams_fullscreenWithStatusBarInputLayer_disallowsInputFallthrough() { final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(/* visible= */ true); taskInfo.configuration.windowConfiguration.setWindowingMode(WINDOWING_MODE_FULLSCREEN); final RelayoutParams relayoutParams = new RelayoutParams(); Loading @@ -724,6 +725,18 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase { assertThat(relayoutParams.hasInputFeatureSpy()).isFalse(); } @Test @EnableFlags(Flags.FLAG_ENABLE_REMOVE_STATUS_BAR_INPUT_LAYER) public void updateRelayoutParams_fullscreenWithoutStatusBarInputLayer_isInputFeatureSpy() { final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(/* visible= */ true); taskInfo.configuration.windowConfiguration.setWindowingMode(WINDOWING_MODE_FULLSCREEN); final RelayoutParams relayoutParams = new RelayoutParams(); updateRelayoutParams(relayoutParams, taskInfo); assertThat(relayoutParams.hasInputFeatureSpy()).isTrue(); } @Test @EnableFlags(Flags.FLAG_ENABLE_ACCESSIBLE_CUSTOM_HEADERS) public void updateRelayoutParams_fullscreen_unlimitedTouchRegion() { Loading