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
diff --git a/services/inputflinger/reader/mapper/TouchInputMapper.h b/services/inputflinger/reader/mapper/TouchInputMapper.h
index e104220..a56468f 100644
--- a/services/inputflinger/reader/mapper/TouchInputMapper.h
+++ b/services/inputflinger/reader/mapper/TouchInputMapper.h
@@ -185,6 +185,8 @@
UNSCALED, // unscaled mapping (touchpad)
NAVIGATION, // unscaled mapping with assist gesture (touch navigation)
POINTER, // pointer mapping (pointer)
+
+ ftl_last = POINTER
};
DeviceMode mDeviceMode;
@@ -198,6 +200,8 @@
TOUCH_PAD,
TOUCH_NAVIGATION,
POINTER,
+
+ ftl_last = POINTER
};
DeviceType deviceType;
@@ -210,6 +214,8 @@
ORIENTATION_90 = DISPLAY_ORIENTATION_90,
ORIENTATION_180 = DISPLAY_ORIENTATION_180,
ORIENTATION_270 = DISPLAY_ORIENTATION_270,
+
+ ftl_last = ORIENTATION_270
};
Orientation orientation;
@@ -219,6 +225,8 @@
enum class GestureMode {
SINGLE_TOUCH,
MULTI_TOUCH,
+
+ ftl_last = MULTI_TOUCH
};
GestureMode gestureMode;
@@ -818,4 +826,4 @@
} // namespace android
-#endif // _UI_INPUTREADER_TOUCH_INPUT_MAPPER_H
\ No newline at end of file
+#endif // _UI_INPUTREADER_TOUCH_INPUT_MAPPER_H