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 Frame, Android 4.1.x.

**Background:**

I'm configuring an old Galaxy Fame to serve as 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, just switches to a power-save status when the car is off. The navigator app – OsmAnd – starts automatically at boot, but 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
* Sat receiver goes off, along with wify 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.