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.

  • what is the model id of this device? meaning sm-blahblah , also can you post your init.rc to a pastebin? You have this device rooted?, grep your ramdisk *.rc's the perms/chown entries should tsp-ish, touch screen panel – moonbutt74 Aug 16 '15 at 0:47
  • run cat /sys/class/sec/sec_touchscreen/set_module_off if it comes back 0 then echo it to 1 and see what happens. Also how do i wrap code in comments? – moonbutt74 Aug 16 '15 at 0:50
  • This is a "Samsung Galaxy Fame gt-s6810p"; /init.rc is here: pastebin.mozilla.org/8842877 ; the device is rooted and I can execute su; 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 – davide Aug 16 '15 at 2:13
  • okay, that's a classic mistake, it's a good thing anything you do at the moment is temporary, cat FIRST to find out if it's a 0 or 1 type of setting. – moonbutt74 Aug 16 '15 at 2:27

davide,

cat your init.rc and under # Permissions for InputDevices.

chown system radio /sys/class/sec/tsp/cmd
chmod 0660 /sys/class/sec/tsp/input/enabled  <--your device may differ
chown system system /sys/class/sec/tsp/input/enabled <--your device may differ

Add to your scripting setup after verifying, for my device, a samsung galaxy tab 4

echo 0 > /sys/class/sec/tsp/input/enabled

Touchscreen slain.

echo 1 > /sys/class/sec/tsp/input/enabled

Touchscreen re-enabled.

m

  • Cool to hear! My phone however doesn't have that control file. The closest things I can approach to by grep-ping under /sys for the strings enable and tsp are: /sys/devices/virtual/sec/tsp/power/autosuspend_delay_ms — which I ignorantly overwrote to 1000, to no avail, and /sys/module/hid_prodikeys/parameters/enable, which I overwrote to N,N,N,N,N,N,N,N attempting to disable the touchkeys, to no avail. Write permissions were set before each write, and no errors prompted. I was probably deceived by the name of those control files. – davide Aug 15 '15 at 23:21
  • I also tried fiddling with /sys/class/sec/sec_touchscreen/set_module_off and /sys/module/hid_magicmouse/parameters/report_touches. – davide Aug 16 '15 at 0:18
  • Did you resolve it ? Is there a way to do that ? – ransh Nov 24 '16 at 18:21

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.