Add toString and remove default case
For a future CL, we will need to print some bools. To facilitate that,
add a "toString" function.
Also, if we add a focus type, it would be good that the compiler
highlights cases where the new type isn't being handled in a switch
statement. Therefore, remove all default cases in switch statements
where feasible.
Because we are now adding an "unused" function that compiler complains
about, also convert DEBUG_TRANSPORT_ACTIONS into a constexpr bool.
Bug: none
Test: presubmit
Change-Id: Ie8472707f1699d2009232b9f36abae9a36a97f5f
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index c219941..aba5a30 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -2295,10 +2295,12 @@
reportTouchEventForStatistics(*motionEntry);
break;
}
-
- default:
- ALOG_ASSERT(false);
+ case EventEntry::Type::CONFIGURATION_CHANGED:
+ case EventEntry::Type::DEVICE_RESET: {
+ LOG_ALWAYS_FATAL("Should never start dispatch cycles for %s events",
+ EventEntry::typeToString(eventEntry->type));
return;
+ }
}
// Check the result.