Evgenii
Evgenii

Reputation: 135

Disable touch screen in Android in accessibility service

I am developing an Android application for the deaf and blind using the accessibility service

Need to disable the touch screen, because android app is controlled through a third-party device

I tried to add a view to WindowManager and disable everything there (FLAG_NOT_FOCUSABLE, FLAG_NOT_TOUCHABLE), but as far as I understand, it disabled the touch screen only in this view, but not at all

I can request any type of permission except the root

EDIT:

Due to Android security, disabling the touchscreen is not possible without root, but you can use Proximity Sensor to disable touchscreen until first power button pressure

Upvotes: 1

Views: 3663

Answers (1)

Mayank Kumar Chaudhari
Mayank Kumar Chaudhari

Reputation: 18538

Congratulations and good will for you are working for a good cause.

Not sure exactly how to do this but One way is to create a full screen activity - hide navigation bar and soft navigation buttons also -- please refer this documentation

And 2. override onBackPressed and never allow it to call super.onBackPressed() or relaunch your app in OnPause() method.

Hope this helps somewhat.

Upvotes: 0

Related Questions