简体   繁体   English

Android SYSTEM_ALERT_WINDOW权限

[英]Android SYSTEM_ALERT_WINDOW permission

I read that with Android 6.0, users need to manually allow apps to hold this permission by going to app advanced settings and enabling "Draw over other apps". 我读到,使用Android 6.0,用户需要手动允许应用程序通过转到应用程序高级设置并启用“绘制其他应用程序”来保留此权限。 I have a Nexus 5 with Android 6.0 but I don't seem to be prompted to enable this setting. 我有一个带有Android 6.0的Nexus 5,但似乎没有提示我启用此设置。 When I install apps from the Play Store that require this permission, such as LastPass, it gets granted automatically. 当我从Play商店安装需要此权限的应用程序(例如LastPass)时,会自动授予该权限。

Why is this so? 为什么会这样?

It is a new behaviour introduced in Marshmallow 6.0.1. 这是Marshmallow 6.0.1中引入的一种新行为。

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. 请求SYSTEM_ALERT_WINDOW权限并通过Play商店(版本6.0.5或更高版本安装)的每个应用程序都将自动授予权限。

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. 您可以尝试从apkmirror.com下载并安装Evernote APK。 As you can see you need to manually grant the permission in Settings -> Apps -> Draw over other apps . 如您所见,您需要在设置 - >应用程序 - >绘制其他应用程序中手动授予权限。

[The above information is from this post .] [以上信息来自这篇文章 。]

If you want the app to be sideloaded, you show manually show a prompt and direct the user to enable Draw over other apps permissions from the settings. 如果您希望侧载应用程序,则会显示手动显示提示并指示用户从设置启用Draw over其他应用程序权限。 Have a look at Requesting permissions 看看请求权限

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. 请求SYSTEM_ALERT_WINDOW权限并通过Play商店(版本6.0.5或更高版本安装)的每个应用程序都将自动授予权限。

Click here ! 点击这里 This may help 这可能有所帮助

There are mainly two types of permissions, they are 它们主要有两种类型的权限

  • Normal Permissions 正常权限
  • Dangerous Permissions 危险的权限

Normal permissions indicates that there's no great risk to the user's privacy or security in letting apps have those permissions. 普通权限表示在允许应用拥有这些权限时,用户的隐私或安全性不会有很大的风险。 For example, users would reasonably want to know whether an app can read their contact information, so users have to grant this permission explicitly. 例如,用户会合理地想知道应用程序是否可以读取其联系信息,因此用户必须明确授予此权限。 By contrast, there's no great risk in allowing an app to vibrate the device, so that permission is designated as normal. 相比之下,允许应用程序振动设备没有很大的风险,因此权限被指定为正常。

Dangerous permissions cover areas where the app wants data or resources that involve the user's private information, or could potentially affect the user's stored data or the operation of other apps. 危险权限涵盖应用程序需要涉及用户私人信息的数据或资源的区域,或者可能会影响用户存储的数据或其他应用程序的操作。 For example, the ability to read the user's contacts is a dangerous permission. 例如,读取用户联系人的权限是一种危险的权限。 If an app declares that it needs a dangerous permission, the user has to explicitly grant the permission to the app. 如果应用声明它需要危险权限,则用户必须明确授予该应用的权限。

In this case, SYSTEM_ALERT_WINDOW comes under Normal permissions, that is if an app declares in its manifest that it needs a normal permission, the system automatically grants the app that permission at install time. 在这种情况下, SYSTEM_ALERT_WINDOW属于普通权限,即如果应用程序在其清单中声明它需要正常权限,系统会在安装时自动授予应用程序该权限。 The system does not prompt the user to grant normal permissions, and users cannot revoke these permissions. 系统不会提示用户授予正常权限,用户也无法撤消这些权限。

You can see the list of normal permissions in this link and dangerous permissions here . 您可以在此处查看链接中的常规权限列表和危险权限。

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

相关问题 如何检查权限在Android Lollipop上授予SYSTEM_ALERT_WINDOW? - How to check permission SYSTEM_ALERT_WINDOW is granted on Android Lollipop? 如何在本机反应中删除 SYSTEM_ALERT_WINDOW android 权限 - How remove SYSTEM_ALERT_WINDOW android permission in react native Android13,SYSTEM_ALERT_WINDOW权限未勾选BroadcastReceiver - Android13, SYSTEM_ALERT_WINDOW permission not checked in BroadcastReceiver Android:SYSTEM_ALERT_WINDOW权限保护级别 - Android: SYSTEM_ALERT_WINDOW permission Protection level SYSTEM_ALERT_WINDOW 的运行时权限 - Runtime permission for SYSTEM_ALERT_WINDOW 通过Appop Denial错误授予SYSTEM_ALERT_WINDOW权限后,Android marshmallow - Android marshmallow after granting permission through Appop Denial error for SYSTEM_ALERT_WINDOW permission 如何在我的 android 应用程序中根据请求自动授予 SYSTEM_ALERT_WINDOW 权限? - How do I grant SYSTEM_ALERT_WINDOW permission automatically on request, in my android App? Whatsapp 如何在 Android 11 上获得 SYSTEM_ALERT_WINDOW 权限? - How does Whatsapp get SYSTEM_ALERT_WINDOW permission on Android 11? SYSTEM_ALERT_WINDOW - 如何在 Android 6.0 和 targetSdkVersion 23 上自动获得此权限 - SYSTEM_ALERT_WINDOW - How to get this permission automatically on Android 6.0 and targetSdkVersion 23 请求 SYSTEM_ALERT_WINDOW 权限后返回应用程序 - Return to app after requesting SYSTEM_ALERT_WINDOW permission
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM