summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorTracy Zhou <tracyzhou@google.com>2023-04-03 15:58:08 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2023-04-03 15:58:08 +0000
commitb04fd885812c55f3e956cfba0b266b5314ef9358 (patch)
treee84d8c958a9bfb5ea438e42f4b5a1bfc714eb5a5 /packages
parent09e43076727f9a727330555165650a169b603fdc (diff)
parentafbd2ae8e746c008fdf7c7009620cc0bf89042fe (diff)
downloadbase-b04fd885812c55f3e956cfba0b266b5314ef9358.tar.gz
Merge "Fix not being able to collapse notification shade using the trackpad" into udc-dev
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java13
1 files changed, 8 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 7b4685216111..d2cb762682c5 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
@@ -18,6 +18,7 @@ package com.android.systemui.shade;
import static android.app.StatusBarManager.WINDOW_STATE_SHOWING;
import static android.view.MotionEvent.CLASSIFICATION_MULTI_FINGER_SWIPE;
+import static android.view.MotionEvent.CLASSIFICATION_TWO_FINGER_SWIPE;
import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE;
@@ -310,7 +311,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
*/
public final boolean mAnimateBack;
- private final boolean mTrackpadGestureBack;
+ private final boolean mTrackpadGestureFeaturesEnabled;
/**
* The minimum scale to "squish" the Shade and associated elements down to, for Back gesture
*/
@@ -859,7 +860,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
mLayoutInflater = layoutInflater;
mFeatureFlags = featureFlags;
mAnimateBack = mFeatureFlags.isEnabled(Flags.WM_SHADE_ANIMATE_BACK_GESTURE);
- mTrackpadGestureBack = mFeatureFlags.isEnabled(Flags.TRACKPAD_GESTURE_FEATURES);
+ mTrackpadGestureFeaturesEnabled = mFeatureFlags.isEnabled(Flags.TRACKPAD_GESTURE_FEATURES);
mFalsingCollector = falsingCollector;
mPowerManager = powerManager;
mWakeUpCoordinator = coordinator;
@@ -4937,7 +4938,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
}
// On expanding, single mouse click expands the panel instead of dragging.
- if (isFullyCollapsed() && event.isFromSource(InputDevice.SOURCE_MOUSE)) {
+ if (isFullyCollapsed() && (event.isFromSource(InputDevice.SOURCE_MOUSE)
+ && !isTrackpadMotionEvent(event))) {
if (event.getAction() == MotionEvent.ACTION_UP) {
expand(true /* animate */);
}
@@ -5092,8 +5094,9 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
}
private boolean isTrackpadMotionEvent(MotionEvent ev) {
- return mTrackpadGestureBack
- && ev.getClassification() == CLASSIFICATION_MULTI_FINGER_SWIPE;
+ return mTrackpadGestureFeaturesEnabled && (
+ ev.getClassification() == CLASSIFICATION_MULTI_FINGER_SWIPE
+ || ev.getClassification() == CLASSIFICATION_TWO_FINGER_SWIPE);
}
}