diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index 27844555926f4..6486134e97342 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -1900,6 +1900,9 @@ public class NotificationPanelViewController extends PanelViewController { private boolean handleQsTouch(MotionEvent event) { + if (mShouldUseSplitNotificationShade && touchXOutsideOfQs(event.getX())) { + return false; + } final int action = event.getActionMasked(); if (action == MotionEvent.ACTION_DOWN && getExpandedFraction() == 1f && mBarState != KEYGUARD && !mQsExpanded && isQsExpansionEnabled()) { @@ -1941,8 +1944,12 @@ public class NotificationPanelViewController extends PanelViewController { return false; } + private boolean touchXOutsideOfQs(float touchX) { + return touchX < mQsFrame.getX() || touchX > mQsFrame.getX() + mQsFrame.getWidth(); + } + private boolean isInQsArea(float x, float y) { - if (x < mQsFrame.getX() || x > mQsFrame.getX() + mQsFrame.getWidth()) { + if (touchXOutsideOfQs(x)) { return false; } // Let's reject anything at the very bottom around the home handle in gesture nav @@ -4086,9 +4093,7 @@ public class NotificationPanelViewController extends PanelViewController { @Override public void flingTopOverscroll(float velocity, boolean open) { // in split shade mode we want to expand/collapse QS only when touch happens within QS - if (mShouldUseSplitNotificationShade - && (mInitialTouchX < mQsFrame.getX() - || mInitialTouchX > mQsFrame.getX() + mQsFrame.getWidth())) { + if (mShouldUseSplitNotificationShade && touchXOutsideOfQs(mInitialTouchX)) { return; } mLastOverscroll = 0f;