From 331afccf4a9b81ddf22500872b7260b532e15c41 Mon Sep 17 00:00:00 2001 From: Vitalii Kulikov Date: Mon, 16 Jan 2017 22:36:29 +0100 Subject: minui: Skip EV_REL input devices. This is causing recovery to skip real input devices on some samsung phones where sensors are registered as input devices. So there more then 16 of them. (ex. ks01lte) And EV_REL input devices already disabled in recovery ui.cpp if BOARD_RECOVERY_NEEDS_REL_INPUT is not set. So do same here not to exceed the limit of MAX_DEVICES Change-Id: If3d6e29d00229278a8ef3dfa445393c9f3d5f361 --- minui/Android.mk | 4 ++++ minui/events.cpp | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/minui/Android.mk b/minui/Android.mk index e74c7be..a8d0aa4 100644 --- a/minui/Android.mk +++ b/minui/Android.mk @@ -44,6 +44,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 120baed..3c635f0 100644 --- a/minui/events.cpp +++ b/minui/events.cpp @@ -78,8 +78,13 @@ int ev_init(ev_callback input_cb, void* data) { continue; } - // We assume that only EV_KEY, EV_REL, EV_SW, and EV_ABS event types are ever needed. + // We assume that only EV_KEY, EV_SW, and EV_ABS event types are ever needed. + // EV_REL should be enabled explicitly in device tree. +#ifdef BOARD_RECOVERY_NEEDS_REL_INPUT if (!test_bit(EV_KEY, ev_bits) && !test_bit(EV_REL, ev_bits) && !test_bit(EV_SW, ev_bits) && !test_bit(EV_ABS, ev_bits)) { +#else + if (!test_bit(EV_KEY, ev_bits) && !test_bit(EV_SW, ev_bits) && !test_bit(EV_ABS, ev_bits)) { +#endif close(fd); continue; } -- cgit v1.1