From 27634c4dc21431b7f9664259edc0fe59d23dd735 Mon Sep 17 00:00:00 2001 From: Evan Rosky Date: Mon, 22 Jun 2020 10:46:05 -0700 Subject: [PATCH] Update the divider touch-region properly The divider view itself isn't really relayouted (because now it's surface just gets moved around). This means we actually need to update its touch region when moving the surface instead of in relayout. Additionally, because the views themselves don't move, update the touch-region from divider position instead. Bug: 159304463 Test: dumpsys uiautomator --windows or turn-on talkback and dumpsys accessibility. Either way see that divider window region/bounds is reported correctly. Change-Id: Ic531ac44af772d1ae187a1087d5fe3b23d21b96e --- .../com/android/systemui/stackdivider/DividerView.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java index 42d8c959371f3..6f554e698c58e 100644 --- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java +++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java @@ -352,8 +352,6 @@ public class DividerView extends FrameLayout implements OnTouchListener, minimizeLeft + mMinimizedShadow.getMeasuredWidth(), minimizeTop + mMinimizedShadow.getMeasuredHeight()); if (changed) { - mWindowManagerProxy.setTouchRegion(new Rect(mHandle.getLeft(), mHandle.getTop(), - mHandle.getRight(), mHandle.getBottom())); notifySplitScreenBoundsChanged(); } } @@ -679,6 +677,14 @@ public class DividerView extends FrameLayout implements OnTouchListener, private void notifySplitScreenBoundsChanged() { mOtherTaskRect.set(mSplitLayout.mSecondary); + mTmpRect.set(mHandle.getLeft(), mHandle.getTop(), mHandle.getRight(), mHandle.getBottom()); + if (isHorizontalDivision()) { + mTmpRect.offsetTo(0, mDividerPositionY); + } else { + mTmpRect.offsetTo(mDividerPositionX, 0); + } + mWindowManagerProxy.setTouchRegion(mTmpRect); + mTmpRect.set(mSplitLayout.mDisplayLayout.stableInsets()); switch (mSplitLayout.getPrimarySplitSide()) { case WindowManager.DOCKED_LEFT: