Modify getPosition of disabled PointerController
PointerChoreographer has to combine fake finger coordinates with
the position of MousePointerController to process some touchpad
events.
The legacy PointerController which is disabled should return
(0, 0) instead of (nan, nan) on getPosition, so that
GestureConverter can set x-y axes correctly.
Test: atest libinputservice_test
Bug: 293587049
Change-Id: I7630cd16defc9324970f0c29851c80f1b9943977
diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp
index 972e168..2e7452d 100644
--- a/libs/input/PointerController.cpp
+++ b/libs/input/PointerController.cpp
@@ -175,8 +175,7 @@
FloatPoint PointerController::getPosition() const {
if (!mEnabled) {
- return FloatPoint{AMOTION_EVENT_INVALID_CURSOR_POSITION,
- AMOTION_EVENT_INVALID_CURSOR_POSITION};
+ return FloatPoint{0, 0};
}
const int32_t displayId = mCursorController.getDisplayId();