4

Long story short, looking for a way to either disable the behaviour of screen turning on/off in reaction to magnets, or disable the Hall sensor (the sensor responsible for the reaction) altogether. The flip cover I have in hand has a weak magnet and thus doesn't turn on/off the screen reliably, hence I want to simply disable the feature and take things into my own hands.

There are a bunch of Xposed modules that do just the job (example), but Android 7+ probably never will get Xposed from what it looks like right now, so a solution without using Xposed is required.

The device in question is a Samsung Galaxy Tab S2 (Qualcomm, Wi-Fi) with root access.

EDIT 1: after some poking around, it seems that /dev/input/event6 corresponds to the Hall sensor on this device - every time I open/close the magnetic lid, it shows an event there. Unfortunately, I still haven't found a way to disable a particular input device.

EDIT 2: I have tried a way to prevent the Hall sensor from reporting back its status, thus effectively disabling the sensor, and it works well. The problem is it requires me to modify the ROM's source code, and although I can handle that as a ROM compiler, I'm sure there are much more people who can't. So still, waiting for a more feasible solution.

Andy Yan
  • 9,554
  • 17
  • 31
  • 56

1 Answers1

1

You can delete /dev/input/event6 directly. Then everything with the Hall sensor will stop working.

To make this happen automatically, you can write a simple script and let it auto-run at boot.

#!/system/bin/sh
exec rm -f /dev/input/event6

To restore without rebooting, examine it with ls -l before deleting (or you have to reboot)

Assume ls -l gave this result:

crw-rw---- root input 13, 68 1970-01-01 00:00 /dev/input/event6

Take note of the two numbers after owner/group, run this to recover

mknod /dev/input/event6 c 13 68
iBug
  • 7,747
  • 8
  • 44
  • 83
  • Your solution worked perfectly on my Galaxy A9 2018. I am wondering how to permanently disable this sensor without having something run at boot. Do you have any suggestions? – Falcon Mar 14 '19 at 02:26
  • @Falcon Sorry, that's not easily possible (you have to modify the kernel or whatever) – iBug Mar 14 '19 at 03:11