SYSTEM_ALERT_WINDOW - 如何在 Android 6.0 和 targetSdkVersion 23 上自动获得此权限 [英] SYSTEM_ALERT_WINDOW - How to get this permission automatically on Android 6.0 and targetSdkVersion 23

查看:40
本文介绍了SYSTEM_ALERT_WINDOW - 如何在 Android 6.0 和 targetSdkVersion 23 上自动获得此权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Facebook、Evernote、Pocket - 所有应用在 Android 6.0 上都会自动获得此权限,即使它们的目标是 23 (targetSdkVersion=23).

Facebook, Evernote, Pocket - all apps get this permission on Android 6.0 automatically, even though they are targeting 23 (targetSdkVersion=23).

有很多关于新棉花糖权限模型的文档.其中之一是 SYSTEM_ALERT_WINDOW 被提升"为危险以上"权限级别,因此需要特殊的用户干预才能授予应用程序这些权限.如果应用具有 targetSdkVersion 22 或更低,应用会自动获得此权限(如果在清单中请求).

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).

但是,我注意到一些应用程序获得了此权限,而无需将用户发送到绘制其他应用程序权限的设置特殊页面.我看到了 Facebook、Evernote、Pocket - 也许还有更多.

However, I've noticed some apps that get this permission, without needing to send the user to the setting special page of Draw over other apps permission. I saw Facebook, Evernote, Pocket - and perhaps there are more.

任何人都知道如何在无需用户通过 Settings -> 的情况下授予应用程序此权限;应用程序 ->在其他应用上绘制?

Anyone knows how an app can be granted this permission without the user go through Settings -> Apps -> Draw over other apps?

谢谢

推荐答案

这是 Marshmallow 6.0.1 中引入的新行为.

It is a new behaviour introduced in Marshmallow 6.0.1.

每个请求 SYSTEM_ALERT_WINDOW 权限并通过 Play 商店安装的应用(需要 6.0.5 或更高版本),都会自动授予权限.

Every app that requests the SYSTEM_ALERT_WINDOW permission and that is installed through the Play Store (version 6.0.5 or higher is required), will have granted the permission automatically.

如果应用是旁加载的,则不会自动授予权限.您可以尝试从 apkmirror.com.如您所见,您需要在 Settings -> 中手动授予权限.应用程序 ->在其他应用上绘制.

If instead the app is sideloaded, the permission is not automatically granted. You can try to download and install the Evernote APK from apkmirror.com. As you can see you need to manually grant the permission in Settings -> Apps -> Draw over other apps.

这些是提交[1] [2] 允许 Play 商店自动授予 SYSTEM_ALERT_WINDOW 权限.

These are the commits [1] [2] that allow the Play Store to give the automatic grant of the SYSTEM_ALERT_WINDOW permission.

这篇关于SYSTEM_ALERT_WINDOW - 如何在 Android 6.0 和 targetSdkVersion 23 上自动获得此权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆