diff options
author | 2021-02-09 18:51:25 -0800 | |
---|---|---|
committer | 2021-09-09 12:35:48 -0700 | |
commit | 7578845a3480cb4237f28729994e19a09caceb55 (patch) | |
tree | 05830c1a55e5ab6b4ca3c901c61ac78fc15d61b1 /services/inputflinger/InputReaderBase.cpp | |
parent | 7be9eaacb54dbdfaf9522f93b104dd0469a0b543 (diff) |
FTL: Extend enum utilities imported from IF
Generalize compile-time and run-time lookup of enumerator names by
recognizing ftl_first and ftl_last to customize the range.
Add enum_range<E>() for iteration using range-based `for` loop.
Bug: 185536303
Test: Check assembly for small LUT in .rodata, and unrolled loops.
Test: ftl_test, libinput_tests, inputflinger_tests
Test: m libinputflinger
Change-Id: I0581611f4cfcf5837b0293867cb323742afb2c87
Diffstat (limited to 'services/inputflinger/InputReaderBase.cpp')
-rw-r--r-- | services/inputflinger/InputReaderBase.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/services/inputflinger/InputReaderBase.cpp b/services/inputflinger/InputReaderBase.cpp index 05ef489133..a864cf8202 100644 --- a/services/inputflinger/InputReaderBase.cpp +++ b/services/inputflinger/InputReaderBase.cpp @@ -19,12 +19,12 @@ //#define LOG_NDEBUG 0 #include "InputReaderBase.h" -#include <ftl/NamedEnum.h> #include "input/DisplayViewport.h" #include "input/Input.h" -#include <android/log.h> #include <android-base/stringprintf.h> +#include <android/log.h> +#include <ftl/enum.h> #define INDENT " " #define INDENT2 " " @@ -117,7 +117,7 @@ std::optional<DisplayViewport> InputReaderConfiguration::getDisplayViewportByTyp } if (count > 1) { ALOGW("Found %zu viewports with type %s, but expected 1 at most", count, - NamedEnum::string(type).c_str()); + ftl::enum_string(type).c_str()); } return result; } |