system-alert-window

Prevent application with SYSTEM_ALERT_WINDOW from obscuring my application

流过昼夜 提交于 2019-12-06 11:15:25
Is there any way to assure that my application's window is not obscured by any other application's view using with SYSTEM_ALERT_WINDOW permission? If not, then is there any better way to assure that my app is not obscured by such window apart from obtaining the same permission and refreshing/showing/whatever my own view (of course shown in alert window) every 100ms or so to keep it visible? Eventual flickering, in case my application is obscured, is actually a good thing and an indicator to the user that something is wrong. EDIT : It seems that there is no way to do it except from going

How to detect when my Activity has been obscured?

怎甘沉沦 提交于 2019-12-04 09:38:03
I would like to be able to detect if my Activity has been obscured by, say, a system alert or some other overlay (for example the power menu when I long press on the power button), or some malware that detects the launch of my Activity. I noticed that the foreground app in this case would still be my app, so I can't simply base it on what the foreground app is. I also notice that onPause() isn't called when my Activity is obscured, so I can't put any logic in onPause() either. Even if I can though, I would then have to differentiate between a system alert/overlay and the user pressing the back

Requesting permissions on Android wear

你。 提交于 2019-11-30 16:08:46
I have written an application that takes advantage of system_alert_window on android wear. Since marshmallow this permission is revoked by default. I have enabled this permission on the phone side app from the phone settings. But the permission is still denied on the android wear side app and causes the android wear side app to crash with permission denied exception. Is there a way to enable this permission on Android wear side? Short answer: keep your watch app on targetSdkVersion 22. Long answer: this permission doesn't use the usual requestPermissions() flow. There's more info in the docs ,

SYSTEM_ALERT_WINDOW - How to get this permission automatically on Android 6.0 and targetSdkVersion 23

纵然是瞬间 提交于 2019-11-26 03:24:35
问题 Facebook, Evernote, Pocket - all apps get this permission on Android 6.0 automatically, even though they are targeting 23 ( targetSdkVersion=23 ). There has been a lot of documentation regarding the new Marshmallow permission model. One of them is SYSTEM_ALERT_WINDOW been \'promoted\' to \'above dangerous\' permission class thus requiring a special user intervention in order for apps to be granted with those. If the app has targetSdkVersion 22 or lower, app gets this permission automatically

SYSTEM_ALERT_WINDOW - How to get this permission automatically on Android 6.0 and targetSdkVersion 23

喜欢而已 提交于 2019-11-26 00:37:27
Facebook, Evernote, Pocket - all apps get this permission on Android 6.0 automatically, even though they are targeting 23 ( targetSdkVersion=23 ). There has been a lot of documentation regarding the new Marshmallow permission model. One of them is SYSTEM_ALERT_WINDOW been 'promoted' to 'above dangerous' permission class thus requiring a special user intervention in order for apps to be granted with those. If the app has targetSdkVersion 22 or lower, app gets this permission automatically (if requested in the manifest). However, I've noticed some apps that get this permission, without needing