简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM