Yeah, Perhaps I should have been more clear about.
Say you installed a new app which needs permissions, this app will show a prompt asking for this permission (image: left). if a screen overlay of some sort (e.g. lux) is working, even if you choose "allow", the permission will not be granted, and the "screen overlay" prompt will then appear (image: right).
I'de like that lux will go to sleep mode, every time this permission prompt loads.
What happens normally is that the permission is denied due to the screen overlay even If I try and turn lux off before I press "Allow".
I hope this makes things a bit clearer.
Sent from my Nexus 6P using XDA Labs