I'm looking for a way to disable and enable the phone's touchscreen via console, and possibly the physical buttons, so to prevent finger touches from being processed. The phone is a Samsung Galaxy Fame, Android 4.1.x.
Background:
I'm configuring an old Galaxy Fame to serve as a sat navigator fixed on my car dashboard, aiming at using the up-to-date and free OpenStreetMap.
When I turn the key, the phone's USB is powered at 5V, when I turn off the car, the USB has no power. The phone is able to detect these events and I scripted some actions upon them, aiming at providing an instant-on and instant-off navigator service.
The phone remains always on and just switches to a power-save status when the car is off. The navigator app – OsmAnd – starts automatically at boot, but the boot does not occur between a car-on / car-off cycle, because the phone remains on to detect the mentioned USB changes.
Currently, what happens when I start the car and the USB gets powered:
- Display is lit (
echo 200 >/sys/class/backlight/panel/brightness
) - Sat receiver is activated
- CPU frequency set to max
What happens when I turn off the car and USB loses power:
- Display's backlight off
- The sat receiver goes off, along with WiFi and Bluetooth, in case they might have been active
- CPU frequency set to minimum
Up to this point, everything is working. My problem now is that, when the car goes off and the phone enters this quasi-standby mode, the touchscreen still accepts input and, if the phone is handled or touched for whatever reason, it will stealthily react to those touches while the screen is unlit.
/init.rc
is here: pastebin.mozilla.org/8842877 ; the device is rooted and I can executesu
;grep
results look interesting but I have not yet experimented with these control files: pastebin.mozilla.org/8842878 . My fiddlings with/sys/class/sec/sec_touchscreen/set_module_off
are here: pastebin.mozilla.org/8842879