Support mouse pointer on external displays (1/3)
If input source is mouse, InputTouchMapper and CursorInputMapper will assign
a PointerController which associated with some display.
When dispatch a motion event, it should be assigned the displayId from
PointerController.
- Add getDisplayId for PointerControllerInterface to get the current
associated display id.
- Add updatePointerDisplay for InputReaderPolicyInterface to find and
associate the specified display viewport.
- Add test cases for TouchInputMapper and CursorInputMapper.
Bug: 113559891
Test: ActivityView test app
Test: atest inputflinger_tests
Change-Id: Ifc69374a55f39fbc1572d9ea3f979fcbb83b45c0
diff --git a/services/inputflinger/include/PointerControllerInterface.h b/services/inputflinger/include/PointerControllerInterface.h
index e94dd94..e60b3f4 100644
--- a/services/inputflinger/include/PointerControllerInterface.h
+++ b/services/inputflinger/include/PointerControllerInterface.h
@@ -58,6 +58,9 @@
/* Gets the absolute location of the pointer. */
virtual void getPosition(float* outX, float* outY) const = 0;
+ /* Gets the id of the display where the pointer should be shown. */
+ virtual int32_t getDisplayId() const = 0;
+
enum Transition {
// Fade/unfade immediately.
TRANSITION_IMMEDIATE,