summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Harry Cutts <hcutts@google.com> 2022-10-13 13:47:51 +0000
committer Harry Cutts <hcutts@google.com> 2022-10-13 13:47:51 +0000
commit6a778e81cd549ed9dfc11b7b59a86f796b33c300 (patch)
tree60f82ef41ed78136839d072590c466664f8883f1
parent39b7ca2933ffde9094aed908a507158d20be3d7a (diff)
Add asserts for new HAL axes in InputCommonConverter
Bug: 246758376 Test: check that build succeeds Change-Id: I13d341fa05819f84b476c412783e4492ab7032b8
-rw-r--r--services/inputflinger/Android.bp2
-rw-r--r--services/inputflinger/InputCommonConverter.cpp5
-rw-r--r--services/inputflinger/tests/fuzzers/Android.bp2
3 files changed, 6 insertions, 3 deletions
diff --git a/services/inputflinger/Android.bp b/services/inputflinger/Android.bp
index ddcd51f357..8714b0397f 100644
--- a/services/inputflinger/Android.bp
+++ b/services/inputflinger/Android.bp
@@ -69,7 +69,7 @@ cc_defaults {
name: "libinputflinger_defaults",
srcs: [":libinputflinger_sources"],
shared_libs: [
- "android.hardware.input.processor-V1-ndk",
+ "android.hardware.input.processor-V2-ndk",
"libbase",
"libbinder",
"libbinder_ndk",
diff --git a/services/inputflinger/InputCommonConverter.cpp b/services/inputflinger/InputCommonConverter.cpp
index 6db89d4759..09f1c0f6f3 100644
--- a/services/inputflinger/InputCommonConverter.cpp
+++ b/services/inputflinger/InputCommonConverter.cpp
@@ -263,7 +263,10 @@ 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.
+static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GESTURE_X_OFFSET) ==
+ common::Axis::GESTURE_X_OFFSET);
+static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GESTURE_Y_OFFSET) ==
+ common::Axis::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) ==
diff --git a/services/inputflinger/tests/fuzzers/Android.bp b/services/inputflinger/tests/fuzzers/Android.bp
index 55c2db6c91..4359a4b7fb 100644
--- a/services/inputflinger/tests/fuzzers/Android.bp
+++ b/services/inputflinger/tests/fuzzers/Android.bp
@@ -55,7 +55,7 @@ cc_defaults {
],
shared_libs: [
"android.hardware.input.classifier@1.0",
- "android.hardware.input.processor-V1-ndk",
+ "android.hardware.input.processor-V2-ndk",
"libbase",
"libbinder",
"libcutils",