1

I already posted a question here. I came up with a solution that could work but I'm running into some issues still. The problem is that sometimes a touch-and-hold is detected at position (339.5; 0) that will only go away after the touchscreen is restarted, which basically means turning the screen off and on again. I have a Moto G7 Power XT1955-4 running on LineageOS 17.1.

My proposed solution would include an app or process that can detect certain touch inputs by reading the file /dev/input/event1 in the same way the command getevent -l does.

Upon detecting such a faulty input, the touchscreen should be restarted. I tried sending these commands:

adb shell "rm -rf /dev/input/event1"
adb shell input tap 500 500

And indeed, after removing event1, the touch at (339.5; 0) is no longer registered and the tap at (500; 500) is the only registered event. The problem is, however, that now I cannot turn my touchscreen back on. I have to reboot my phone.

So basically, I need a different method to restart my touchscreen. I tried the following:

  1. Sending a keyevent 26 twice (2x powerbutton). This is not ideal since I have to wait for the screen to turn on and off completely (I only need to restart touch) and I have to put my code or fingerprint again
  2. By searching through the {*}.rc files I found that the hardware of the screen is mounted in the following directory: /sys/devices/platform/soc/78b7000.i2c/i2c-3/3-0062. In there there is a file called poweron that contains a 1 when the screen is on and a 0 when the screen is off. I tried manually writing this value but I get a no permission error. I'm rooted and remounted the partition RW. I also tried chmod 0666 poweron && echo 0 > poweron but it doesn't change the file. I guess the file is a system output value.
  3. I believe the touchscreen and LCD are two different devices in my system and I did manage to find the touchscreen in the /sys partition: /sys/class/touchscreen/NVT-ts/. However, it has no file containing a 1 or a 0 for the power state of the touchscreen. If it did, I could probably not even write to it.
  4. As described above, I tried removing event1. I then tried manually remounting it, but failed. event1 is not in /proc/mounts so I'm left with no clue on how to mount it.
  5. I tried searching through the system files for the word "event1" to see if I can figure out where and how the system handles mounting this hardware. But after 10 seconds the system just crashes and the phone reboots.
  6. Temporarily moving the event1 file to a different location is not possible. I can move it within /dev/* but touch inputs will still be registered. I cannot move it outside /dev, say store it temporarily in /storage/emulated/0. The command just hangs.
  7. I tried setting the screen brigthness to 0 with the hope that this would cut power to the screen and resetting the touchscreen: echo 0 > /sys/class/leds/lcd-backlight/brightness. The screen does seem to turn off but when I increase brightness again, the problem is still there. Ergo, the touchscreen was not reset.
  8. I tried partial screen app. Glitch keeps happening and partial screen can do nothing about it.

I seem to be able to control some parts of the system but not the power going into the touchscreen. I already came this far in solving the problem. Please assist in restarting the touchscreen in a fast manner, which doesn't require me to turn my screen off and on.

Also, any tips on how build an app or process that can detect inputs and execute the screen restart are very welcome. I really don't care how, as long as it works and can run in the background.

15
  • 1
    why not just send the release command with toybox sendevent?
    – alecxs
    Jan 14 at 11:02
  • Thanks. I used this (dropbox.com/s/ugc9j6f1bqu0qw0/geteventsendevent.sh) link to find the DEVICE, TYPE, CODE and VALUE arguments of a touch input. But how does this help me restart the screen? And by that I mean just the touchscreen, not the whole screen.
    – Anteino
    Jan 14 at 11:17
  • How? I used the same script to see which event was sent upon releasing the screen and it said: sendevent /dev/input/event1 3 57 4294967295. But there are a few problems with this. It does not specify which location to release. Also, when I send it after the screen is in glitched state nothing changes.
    – Anteino
    Jan 14 at 11:38
  • The "input" command can be used for presses, taps, swipes, etc but not releases.
    – Anteino
    Jan 14 at 11:42
  • A sendevent you cannot specify at specific coordinates as far as I can tell. Can you give an example of how such a release would look?
    – Anteino
    Jan 14 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.