summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Justin Weir <justinweir@google.com> 2022-12-09 14:52:40 -0500
committer Justin Weir <justinweir@google.com> 2022-12-13 12:21:57 +0000
commitb72e0002ac480ddb44f23f2968f33e0bfe21641c (patch)
treeb90181386c12494c13d09ff1574797285a695fd8
parentb08cafd9919cd457dc1e9235f562436bd9c02c21 (diff)
Make touchXOutsideOfQs require split shade to be enabled
Also renames the method and adds doc. There were 3 calls to touchXOutsideOfQs and two of the usages were also checking whether split shade was enabled. Adding the split shade check to the third fixed b/259591763. Since all usages are paired with the split shade check, I've moved that into the method and renamed it accordingly. Fixes: 259591763 Test: manual and atest Change-Id: I01edaeceac0a04cc1d2d9af22fbdaf88d3a3162f
-rw-r--r--packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
index e33248cc5a2b..1cfb65f2ca41 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
@@ -2325,7 +2325,7 @@ public final class NotificationPanelViewController implements Dumpable {
private boolean handleQsTouch(MotionEvent event) {
- if (mSplitShadeEnabled && touchXOutsideOfQs(event.getX())) {
+ if (isSplitShadeAndTouchXOutsideQs(event.getX())) {
return false;
}
final int action = event.getActionMasked();
@@ -2382,12 +2382,14 @@ public final class NotificationPanelViewController implements Dumpable {
return false;
}
- private boolean touchXOutsideOfQs(float touchX) {
- return touchX < mQsFrame.getX() || touchX > mQsFrame.getX() + mQsFrame.getWidth();
+ /** Returns whether split shade is enabled and an x coordinate is outside of the QS frame. */
+ private boolean isSplitShadeAndTouchXOutsideQs(float touchX) {
+ return mSplitShadeEnabled && (touchX < mQsFrame.getX()
+ || touchX > mQsFrame.getX() + mQsFrame.getWidth());
}
private boolean isInQsArea(float x, float y) {
- if (touchXOutsideOfQs(x)) {
+ if (isSplitShadeAndTouchXOutsideQs(x)) {
return false;
}
// Let's reject anything at the very bottom around the home handle in gesture nav
@@ -5316,7 +5318,7 @@ public final class NotificationPanelViewController implements Dumpable {
@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 (mSplitShadeEnabled && touchXOutsideOfQs(mInitialTouchX)) {
+ if (isSplitShadeAndTouchXOutsideQs(mInitialTouchX)) {
return;
}
mLastOverscroll = 0f;