Allow two finger gesture from trackpad to pull down notification from home
Fixes: 255602235
Test: manual
Change-Id: I99742320b322a1e7b04bad0e374fcc48f8871ce1
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index f70511a..c11de7f 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -16,6 +16,9 @@
package com.android.launcher3;
+import static android.view.InputDevice.SOURCE_TOUCHSCREEN;
+
+import static com.android.launcher3.config.FeatureFlags.ENABLE_TRACKPAD_GESTURE;
import static com.android.launcher3.icons.BitmapInfo.FLAG_THEMED;
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_ICON_BADGED;
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
@@ -917,6 +920,13 @@
return options;
}
+ public static boolean isTrackpadMotionEvent(MotionEvent event) {
+ // TODO: ideally should use event.getClassification(), but currently only the move
+ // events get assigned the correct classification.
+ return ENABLE_TRACKPAD_GESTURE.get()
+ && (event.getSource() & SOURCE_TOUCHSCREEN) != SOURCE_TOUCHSCREEN;
+ }
+
public static boolean bothNull(@Nullable Object a, @Nullable Object b) {
return a == null && b == null;
}