Convert connection status to enum class
This allows us to print the value using ftl::enum_string
Bug: 206861133
Test: printed the connection status locally
Change-Id: I1042c4ab785eae2d703cf5e6e3c0f7c50d6be6c1
diff --git a/services/inputflinger/dispatcher/Entry.cpp b/services/inputflinger/dispatcher/Entry.cpp
index 1674afd..f6bb6a6 100644
--- a/services/inputflinger/dispatcher/Entry.cpp
+++ b/services/inputflinger/dispatcher/Entry.cpp
@@ -289,11 +289,10 @@
std::string SensorEntry::getDescription() const {
std::string msg;
- std::string sensorTypeStr(ftl::enum_name(sensorType).value_or("?"));
msg += StringPrintf("SensorEntry(deviceId=%d, source=%s, sensorType=%s, "
"accuracy=0x%08x, hwTimestamp=%" PRId64,
- deviceId, inputEventSourceToString(source).c_str(), sensorTypeStr.c_str(),
- accuracy, hwTimestamp);
+ deviceId, inputEventSourceToString(source).c_str(),
+ ftl::enum_string(sensorType).c_str(), accuracy, hwTimestamp);
if (!GetBoolProperty("ro.debuggable", false)) {
for (size_t i = 0; i < values.size(); i++) {