Some devices have extra security features and check if an app is drawing on top of others, when showing a permission dialog.
I have a sidebar app, and my app has to be disabled, before users can accept a system dialog.
Questions
- How am I supposed to handle this case?
- Is there a way to listen for an "System dialog shown" event, so that I can remove my sidebar and a "System dialog finished" so that I know, i can continue with my sidebar overlay? I know, that it's enough to stop the service (you don't have to remove the permission), so this would be a solution as well
EDIT
One solution I can think of is following:
Using the AccessibilityService
to check current foreground apps/views. There I will be able to check events that show me current foreground activities and even views...
My problems:
- I don't know how to identify a permission dialog there.
- Secondly, this forces me to ask the user to get this permission (which I want to avoid, but having a solution with this service, would already be an improvement for me, because some users give this permission to my app already - I would have to ask all then and explain the reason, which is something I can live with).