system-alert-window

How to detect when Facebook messenger is bubble is opend?

可紊 提交于 2021-02-08 03:59:24
问题 Facebook uses a service to push the messenger bubble on android - something like the follows: http://www.piwai.info/chatheads-basics/ I want to detect when the bubble is opened / closed I've started investigating the following options - Listen (By pulling) to the running services - I found out there are 4 services when the messenger is shown and 2 when it's killed. I want to know when the messenger bubble is close so it doesn't help me. Listen to the notifications - I know when it's removed

Prevent application with SYSTEM_ALERT_WINDOW from obscuring my application

[亡魂溺海] 提交于 2020-02-02 06:28:56
问题 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

Prevent application with SYSTEM_ALERT_WINDOW from obscuring my application

半世苍凉 提交于 2020-02-02 06:28:04
问题 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

How to check for apps which has Draw over other apps as True?

二次信任 提交于 2020-01-05 07:12:38
问题 I am a bit puzzled over getting active system alert window permissions for a package in Android. I am using the code below, but this code returns 0 even if we disallow that app from "Draw over other app". Any Pointers?. My use case is to have a check in place where if any app with system_alert_window permission is found, we need to tell user to change that apps permission to proceed further. packageManager.checkPermission("android.permission.SYSTEM_ALERT_WINDOW", info.packageName) 回答1: I

Avoid Screen Overlay Detected for service that uses SYSTEM_ALERT_WINDOW

僤鯓⒐⒋嵵緔 提交于 2020-01-03 03:21:16
问题 My app main usage is overlay, the overlay is running from a service. Android Security add the nice "Screen Overlay Detected" I want to avoid "Screen Overlay Detected" when user tries to change permissions. so... I've add an AccessiblityService that detects: if ( event.getPackageName().equals("com.google.android.packageinstaller") ){ stopService(myServiceIntent); } However, even now I see this message popping. (when my service is stopped...). I saw Twilight does it without problem. What am I

Avoid Screen Overlay Detected for service that uses SYSTEM_ALERT_WINDOW

 ̄綄美尐妖づ 提交于 2020-01-03 03:21:15
问题 My app main usage is overlay, the overlay is running from a service. Android Security add the nice "Screen Overlay Detected" I want to avoid "Screen Overlay Detected" when user tries to change permissions. so... I've add an AccessiblityService that detects: if ( event.getPackageName().equals("com.google.android.packageinstaller") ){ stopService(myServiceIntent); } However, even now I see this message popping. (when my service is stopped...). I saw Twilight does it without problem. What am I

Requesting permissions on Android wear

限于喜欢 提交于 2019-12-30 05:23:18
问题 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? 回答1: Short answer: keep your watch app on targetSdkVersion 22.

How to detect when my Activity has been obscured?

橙三吉。 提交于 2019-12-21 17:49:55
问题 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

show popup window on lock screen

十年热恋 提交于 2019-12-12 04:55:23
问题 I have implemented a caller ID feature where when the screen is locked it should open the lock and show the popup with the name of the person calling. this is the code i've added in the onCreate() of the PopupActivity. getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE); getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager

Settings.canDrawOverlays is returning false even after turning the permission on from settings

孤人 提交于 2019-12-10 15:22:47
问题 I am trying billow Code from this answer to check if the permission is enabled. but it is returning false even when the permission is enabled from the settings. public static boolean canDrawOverlayViews(Context con){ if(Build.VERSION.SDK_INT< Build.VERSION_CODES.LOLLIPOP){return true;} try { return Settings.canDrawOverlays(con); } catch(NoSuchMethodError e){ return canDrawOverlaysUsingReflection(con); } } public static boolean canDrawOverlaysUsingReflection(Context context) { try {