I am developing such application, that
- is running in full screen KIOSK mode and it is advertising until a user touches the screen
- when somebody touches the screen the application finishes the advertising activity and start a service
- when the activity is in the background, user can try the device (e.g. open Camera, check Android About page in Settings)
- to prevent user to do some harm (e.g. factory reset device) I set the application as a device owner and set some user restrictions
- the service watches the touches on the screen and after 30 seconds it restarts the advertising
- to capture screen touches in a service I add a 1x1dp transparent view to the WM as an overlay and watch the outside touch of the view
My problem is, that
- I can't disable user to turn off Manage Overlay permission in the Android Settings, if the permission is turned off it halts the advertising process
- My second approach is that I write an Accessibility Service and handle the TOUCH_INTERACTION_START and TOUCH_INTERACTION_END event types, but in this case user can disable the Accessibility Service so the problem is the same
I would be very grateful if somebody can help me how to pass this problem or could suggest a third kind approach
Thanks,