Automatically generate flag value strings for flag enums.

Since there can generally only be a maximum of 64 flags for a given
flage type, it isn't that expensive to generate the array of names at
compile time by enumerating the possible flag values and then using a
templated function's debug signature to extract the name. The debug
signature should be relatively stable, and I've confirmed this works on
both GCC as well as clang. If our parsing fails, however, we should just
fallback to bare hex values again. Our tests should hopefully prevent
this from happening for any extended period of time.

Bug: 160010896
Test: atest libinput_tests
Change-Id: I752100bbefb92e7a0ecf7a8473a47e37ff7b1662
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index da09898..5cdbfa3 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -4229,8 +4229,7 @@
                                          toString(windowInfo->hasWallpaper),
                                          toString(windowInfo->visible),
                                          toString(windowInfo->canReceiveKeys),
-                                         windowInfo->flags.string(InputWindowInfo::flagToString)
-                                                 .c_str(),
+                                         windowInfo->flags.string().c_str(),
                                          static_cast<int32_t>(windowInfo->type),
                                          windowInfo->frameLeft, windowInfo->frameTop,
                                          windowInfo->frameRight, windowInfo->frameBottom,