简体   繁体   English

如何检查将其他应用程式的绘图设为True的应用程式?

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

I am a bit puzzled over getting active system alert window permissions for a package in Android. 我对在Android中获取软件包的活动系统警报窗口权限感到有些困惑。 I am using the code below, but this code returns 0 even if we disallow that app from "Draw over other app". 我正在使用下面的代码,但是即使我们从“在其他应用程序上绘制”中禁止该应用程序,该代码也会返回0。 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. 我的用例是检查是否找到了具有system_alert_window permission应用程序,我们需要告诉用户更改该应用程序的权限以进一步进行操作。

packageManager.checkPermission("android.permission.SYSTEM_ALERT_WINDOW", info.packageName) packageManager.checkPermission(“ android.permission.SYSTEM_ALERT_WINDOW”,info.packageName)

I created this method to check if the permission is given or not 我创建了此方法来检查是否授予了权限

public static boolean checkDrawOverlayPermission(Context context) {
        /** check if we already  have permission to draw over other apps */
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            return Settings.canDrawOverlays(context);
        }
        return true;
    }

You can after that, if you want to guide the user to the place where he can enable that option do : 之后,如果您想将用户引导至可以启用该选项的地方,请执行以下操作:

Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
                    Uri.parse("package:" + activity.getPackageName()));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何绘制抽取其他应用程序的应用程序? - 确定优先顺序? - How to draw over apps that draw over other apps? - Setting Priorities? 如何在键盘下绘制其他应用程序? - How to draw over other apps but under keyboard? 使用帮助辅助功能服务在其他应用程序上绘制视图的多个应用程序无法同时运行 - Several apps which draw view over other apps with help Accessibility service doesn't work at the same time 如何在React-native中使用其他应用程序? - How to draw over other apps in React-native? 如何以编程方式授予 android 中的“绘制其他应用程序”权限? - How to programmatically grant the "draw over other apps" permission in android? 绘制其他不适用于Android 8.0的应用程序 - Draw over other apps not working on android 8.0 “借鉴其他应用程序”改变听众? - “Draw over other apps” change listener? 检查自定义ROM的应用程序绘制权限 - check permission of draw over apps for Custom ROM AccessibilityService 如何利用其他应用程序? - How does AccessibilityService draw on top of other apps? Android 应用程序(如 Uber、Swiggy、Rapido)如何能够在没有任何特殊许可的情况下在其他应用程序上绘制小地图? - How Android apps like Uber, Swiggy, Rapido are able to draw small maps over other apps without any special permission?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM