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
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index cd427f0..0f7991a 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -1862,11 +1862,12 @@
entry.yPrecision, entry.downTime);
for (uint32_t i = 0; i < entry.pointerCount; i++) {
- ALOGD(" Pointer %d: id=%d, toolType=%d, "
+ ALOGD(" Pointer %d: id=%d, toolType=%s, "
"x=%f, y=%f, pressure=%f, size=%f, "
"touchMajor=%f, touchMinor=%f, toolMajor=%f, toolMinor=%f, "
"orientation=%f",
- i, entry.pointerProperties[i].id, entry.pointerProperties[i].toolType,
+ i, entry.pointerProperties[i].id,
+ ftl::enum_string(entry.pointerProperties[i].toolType).c_str(),
entry.pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_X),
entry.pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_Y),
entry.pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_PRESSURE),
@@ -4178,7 +4179,7 @@
ALOGD(" Pointer %d: id=%d, toolType=%s, x=%f, y=%f, pressure=%f, size=%f, "
"touchMajor=%f, touchMinor=%f, toolMajor=%f, toolMinor=%f, orientation=%f",
i, args->pointerProperties[i].id,
- motionToolTypeToString(args->pointerProperties[i].toolType),
+ ftl::enum_string(args->pointerProperties[i].toolType).c_str(),
args->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_X),
args->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_Y),
args->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_PRESSURE),