From 49f94b5919de0db0ada4e81f93219e8d4ffa95c6 Mon Sep 17 00:00:00 2001 From: Byoungho Jung Date: Mon, 30 Oct 2023 17:41:28 +0900 Subject: 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 --- libs/input/PointerController.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libs/input/PointerController.cpp') diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp index 972e16841f49..2e7452d780eb 100644 --- a/libs/input/PointerController.cpp +++ b/libs/input/PointerController.cpp @@ -175,8 +175,7 @@ void PointerController::setPosition(float x, float y) { 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(); -- cgit v1.2.3-59-g8ed1b