diff options
-rw-r--r-- | minui/Android.mk | 4 | ||||
-rw-r--r-- | minui/events.cpp | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/minui/Android.mk b/minui/Android.mk index cc8be3d8..d817e13f 100644 --- a/minui/Android.mk +++ b/minui/Android.mk @@ -65,6 +65,10 @@ ifneq ($(BOARD_RECOVERY_NEEDS_FBIOPAN_DISPLAY),) LOCAL_CFLAGS += -DBOARD_RECOVERY_NEEDS_FBIOPAN_DISPLAY endif +ifneq ($(BOARD_RECOVERY_NEEDS_REL_INPUT),) + LOCAL_CFLAGS += -DBOARD_RECOVERY_NEEDS_REL_INPUT +endif + include $(BUILD_STATIC_LIBRARY) # Used by OEMs for factory test images. diff --git a/minui/events.cpp b/minui/events.cpp index f11f7eb6..60ea9b75 100644 --- a/minui/events.cpp +++ b/minui/events.cpp @@ -77,9 +77,14 @@ int ev_init(ev_callback input_cb, bool allow_touch_inputs) { continue; } - // We assume that only EV_KEY, EV_REL, and EV_SW event types are ever needed. EV_ABS is also + // We assume that only EV_KEY, and EV_SW event types are ever needed. EV_ABS is also // allowed if allow_touch_inputs is set. - if (!test_bit(EV_KEY, ev_bits) && !test_bit(EV_REL, ev_bits) && !test_bit(EV_SW, ev_bits)) { + // EV_REL should be enabled explicitly in device tree. + if (!test_bit(EV_KEY, ev_bits) && +#ifdef BOARD_RECOVERY_NEEDS_REL_INPUT + !test_bit(EV_REL, ev_bits) && +#endif + !test_bit(EV_SW, ev_bits)) { if (!allow_touch_inputs || !test_bit(EV_ABS, ev_bits)) { close(fd); continue; |