summaryrefslogtreecommitdiff
path: root/services/inputflinger/NotifyArgs.cpp
diff options
context:
space:
mode:
author Siarhei Vishniakou <svv@google.com> 2022-07-21 17:27:03 -0700
committer Cherrypicker Worker <android-build-cherrypicker-worker@google.com> 2023-03-28 13:25:59 +0000
commit6d73f83c0a0ba15a7488916a435d0b2985d4f2a0 (patch)
tree3af68b4ac5e85de49c765c334a3f9edc395182b7 /services/inputflinger/NotifyArgs.cpp
parentfedaf918d50517fdff7ff7945ce032683c8e2b93 (diff)
Convert tool type to enum class
For better type safety, use enum class when sending tool type. Bug: 198472780 Test: atest libinput_tests inputflinger_tests (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:09a8fe42ba1d218c2f445e4fd5bc387e260ae067) Merged-In: I371f08087b9513b6f75966c124de77bc12f8324e Change-Id: I371f08087b9513b6f75966c124de77bc12f8324e
Diffstat (limited to 'services/inputflinger/NotifyArgs.cpp')
-rw-r--r--services/inputflinger/NotifyArgs.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/inputflinger/NotifyArgs.cpp b/services/inputflinger/NotifyArgs.cpp
index b192ad73c3..5f2a22f467 100644
--- a/services/inputflinger/NotifyArgs.cpp
+++ b/services/inputflinger/NotifyArgs.cpp
@@ -161,9 +161,9 @@ std::string NotifyMotionArgs::dump() const {
StringPrintf("id=%" PRIu32 " x=%.1f y=%.1f pressure=%.1f", pointerProperties[i].id,
pointerCoords[i].getX(), pointerCoords[i].getY(),
pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_PRESSURE));
- const int32_t toolType = pointerProperties[i].toolType;
- if (toolType != AMOTION_EVENT_TOOL_TYPE_FINGER) {
- coords += StringPrintf(" toolType=%s", motionToolTypeToString(toolType));
+ const ToolType toolType = pointerProperties[i].toolType;
+ if (toolType != ToolType::FINGER) {
+ coords += StringPrintf(" toolType=%s", ftl::enum_string(toolType).c_str());
}
const float major = pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_TOUCH_MAJOR);
const float minor = pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_TOUCH_MINOR);