Loading services/core/java/com/android/server/wm/WindowState.java +18 −10 Original line number Diff line number Diff line Loading @@ -2624,6 +2624,13 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // events can slip to activity from letterbox. mActivityRecord.getLetterboxInnerBounds(mTmpRect); if (mTmpRect.isEmpty()) { final Rect transformedBounds = mActivityRecord.getFixedRotationTransformDisplayBounds(); if (transformedBounds != null) { // Task is in the same orientation as display, so the rotated bounds should be // chosen as the touchable region. Then when the surface layer transforms the // region to display space, the orientation will be consistent. mTmpRect.set(transformedBounds); } else { // If this is a modal window we need to dismiss it if it's not full screen // and the touch happens outside of the frame that displays the content. This // means we need to intercept touches outside of that window. The dim layer Loading @@ -2636,6 +2643,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP getRootTask().getDimBounds(mTmpRect); } } } adjustRegionInFreefromWindowMode(mTmpRect); outRegion.set(mTmpRect); cropRegionToStackBoundsIfNeeded(outRegion); Loading services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java +6 −0 Original line number Diff line number Diff line Loading @@ -739,6 +739,12 @@ public class WindowStateTests extends WindowTestsBase { InputMonitor.setInputWindowInfoIfNeeded(transaction, sc, handleWrapper); verify(transaction, never()).setInputWindowInfo(any(), any()); // The rotated bounds have higher priority as the touchable region. final Rect rotatedBounds = new Rect(0, 0, 123, 456); doReturn(rotatedBounds).when(win.mToken).getFixedRotationTransformDisplayBounds(); mDisplayContent.getInputMonitor().populateInputWindowHandle(handleWrapper, win); assertEquals(rotatedBounds, handle.touchableRegion.getBounds()); // Populate as an overlay to disable the input of window. InputMonitor.populateOverlayInputInfo(handleWrapper, false /* isVisible */); // The overlay attributes should be set. Loading Loading
services/core/java/com/android/server/wm/WindowState.java +18 −10 Original line number Diff line number Diff line Loading @@ -2624,6 +2624,13 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // events can slip to activity from letterbox. mActivityRecord.getLetterboxInnerBounds(mTmpRect); if (mTmpRect.isEmpty()) { final Rect transformedBounds = mActivityRecord.getFixedRotationTransformDisplayBounds(); if (transformedBounds != null) { // Task is in the same orientation as display, so the rotated bounds should be // chosen as the touchable region. Then when the surface layer transforms the // region to display space, the orientation will be consistent. mTmpRect.set(transformedBounds); } else { // If this is a modal window we need to dismiss it if it's not full screen // and the touch happens outside of the frame that displays the content. This // means we need to intercept touches outside of that window. The dim layer Loading @@ -2636,6 +2643,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP getRootTask().getDimBounds(mTmpRect); } } } adjustRegionInFreefromWindowMode(mTmpRect); outRegion.set(mTmpRect); cropRegionToStackBoundsIfNeeded(outRegion); Loading
services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java +6 −0 Original line number Diff line number Diff line Loading @@ -739,6 +739,12 @@ public class WindowStateTests extends WindowTestsBase { InputMonitor.setInputWindowInfoIfNeeded(transaction, sc, handleWrapper); verify(transaction, never()).setInputWindowInfo(any(), any()); // The rotated bounds have higher priority as the touchable region. final Rect rotatedBounds = new Rect(0, 0, 123, 456); doReturn(rotatedBounds).when(win.mToken).getFixedRotationTransformDisplayBounds(); mDisplayContent.getInputMonitor().populateInputWindowHandle(handleWrapper, win); assertEquals(rotatedBounds, handle.touchableRegion.getBounds()); // Populate as an overlay to disable the input of window. InputMonitor.populateOverlayInputInfo(handleWrapper, false /* isVisible */); // The overlay attributes should be set. Loading