Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d56901b authored by Vitalii Kulikov's avatar Vitalii Kulikov Committed by Michael Bestas
Browse files

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
(cherry picked from commit 331afccf)
(cherry picked from commit e7597e93)
parent b910bb3b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -74,6 +74,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)

# libminui (shared library)
+7 −2
Original line number Diff line number Diff line
@@ -78,9 +78,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;