From 6d73f83c0a0ba15a7488916a435d0b2985d4f2a0 Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Thu, 21 Jul 2022 17:27:03 -0700 Subject: 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 --- services/inputflinger/NotifyArgs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'services/inputflinger/NotifyArgs.cpp') 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); -- cgit v1.2.3-59-g8ed1b