summaryrefslogtreecommitdiff
path: root/services/inputflinger/InputCommonConverter.cpp
diff options
context:
space:
mode:
author Harry Cutts <hcutts@google.com> 2022-10-05 15:55:48 +0000
committer Harry Cutts <hcutts@google.com> 2022-10-13 10:39:16 +0000
commit39b7ca2933ffde9094aed908a507158d20be3d7a (patch)
treea0e3ebef1f565839d919186480e0b4a833990a64 /services/inputflinger/InputCommonConverter.cpp
parentf1f601e01d6af47d658b7ba30fbe8f4b8f84b283 (diff)
Report motion offsets for touchpad swipes
Adds two new axes, AXIS_GESTURE_X_OFFSET and AXIS_GESTURE_Y_OFFSET, which report the movement of swipe gestures on the touchpad as a fraction of the touchpad's size. Bug: 246758376 Test: check axis values come through in a test app Change-Id: I313410053a8db13273bd05a33d3a6a1f75081dae
Diffstat (limited to 'services/inputflinger/InputCommonConverter.cpp')
-rw-r--r--services/inputflinger/InputCommonConverter.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/inputflinger/InputCommonConverter.cpp b/services/inputflinger/InputCommonConverter.cpp
index 23b6f57b23..6db89d4759 100644
--- a/services/inputflinger/InputCommonConverter.cpp
+++ b/services/inputflinger/InputCommonConverter.cpp
@@ -263,8 +263,11 @@ static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_13) == common
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_14) == common::Axis::GENERIC_14);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_15) == common::Axis::GENERIC_15);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_16) == common::Axis::GENERIC_16);
+// TODO(hcutts): add GESTURE_X_OFFSET and GESTURE_Y_OFFSET.
+// If you added a new axis, consider whether this should also be exposed as a HAL axis. Update the
+// static_assert below and add the new axis here, or leave a comment summarizing your decision.
static_assert(static_cast<common::Axis>(AMOTION_EVENT_MAXIMUM_VALID_AXIS_VALUE) ==
- static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_16));
+ static_cast<common::Axis>(AMOTION_EVENT_AXIS_GESTURE_Y_OFFSET));
static common::VideoFrame getHalVideoFrame(const TouchVideoFrame& frame) {
common::VideoFrame out;