Allow edge resizing using touchpad.
Test: manual test
Flag: com.android.window.flags.enable_windowing_edge_drag_resize
Fix: 358334119
Change-Id: If1518753f700c8825db88899f686ffc8661344a9
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeWindowGeometry.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeWindowGeometry.java
index fd7bed7..6dedf6d 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeWindowGeometry.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeWindowGeometry.java
@@ -16,6 +16,7 @@
package com.android.wm.shell.windowdecor;
+import static android.view.InputDevice.SOURCE_MOUSE;
import static android.view.InputDevice.SOURCE_TOUCHSCREEN;
import static com.android.wm.shell.shared.desktopmode.DesktopModeFlags.EDGE_DRAG_RESIZE;
@@ -166,7 +167,10 @@
static boolean isEdgeResizePermitted(@NonNull Context context, @NonNull MotionEvent e) {
if (EDGE_DRAG_RESIZE.isEnabled(context)) {
return e.getToolType(0) == MotionEvent.TOOL_TYPE_STYLUS
- || e.getToolType(0) == MotionEvent.TOOL_TYPE_MOUSE;
+ || e.getToolType(0) == MotionEvent.TOOL_TYPE_MOUSE
+ // Touchpad input
+ || (e.isFromSource(SOURCE_MOUSE)
+ && e.getToolType(0) == MotionEvent.TOOL_TYPE_FINGER);
} else {
return e.getToolType(0) == MotionEvent.TOOL_TYPE_MOUSE;
}