Fix hover icon when drag resizing a freeform window with a stylus.
getXCursorPosition() returns NaN when using a stylus. Using getX()
returns the X coordinate for pointer index 0 regardless of the pointer
identifier.
Test: manual test with a stylus and a mouse and resize a freeform window
Flag: EXEMPT minor bug fix
Fixes: 336268312
Change-Id: I3f413f7fc93876fd02340ae56a1c5c28f3d2dc4c
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeInputListener.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeInputListener.java
index a3616f6..32df8b3 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeInputListener.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeInputListener.java
@@ -468,8 +468,7 @@
case MotionEvent.ACTION_HOVER_ENTER:
case MotionEvent.ACTION_HOVER_MOVE: {
updateCursorType(e.getDisplayId(), e.getDeviceId(),
- e.getPointerId(/*pointerIndex=*/0), e.getXCursorPosition(),
- e.getYCursorPosition());
+ e.getPointerId(/*pointerIndex=*/0), e.getX(), e.getY());
result = true;
break;
}