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.

4
  • I suppose it's possible by writing something to somewhere under /sys. Well, root required, of course.
    – iBug
    Commented Jul 6, 2017 at 2:01
  • Thinking of the same, and one can indeed do it that way on a Nexus 7 (2013), but different devices have different /sys structures, and that's the complication...
    – Andy Yan
    Commented Jul 6, 2017 at 4:22
  • What's wrong with opening Settings and turning the thing off there? Commented Jan 16, 2019 at 12:53
  • @MatthiasUrlichs Most devices don't have such a setting. It's not a part of AOSP.
    – Andy Yan
    Commented Jan 17, 2019 at 1:28

1 Answer 1

1
+50

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
2
  • 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
    Commented Mar 14, 2019 at 2:26
  • @Falcon Sorry, that's not easily possible (you have to modify the kernel or whatever)
    – iBug
    Commented Mar 14, 2019 at 3:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .