版本的Andr​​oid M允许安装/更新行为 [英] Android M permission install/update behavior

查看:163
本文介绍了版本的Andr​​oid M允许安装/更新行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Android的棉花糖有一个新的许可模式。实施新的模式是不是一个大问题为我受影响的应用程序的权限。但也有各地的安装和更新行为的一些问题。我确定某些情况下这对我很重要。我知道官方文档( https://developer.android.com/ preVIEW /功能/运行时permissions.html ),有些事情可能是明确的,但我想是肯定的。


  1. 应用与目标SDK最大。安装一个M设备上22,并授予所有权限 - >使用新的权限模型更新的应用程序


  2. 应用与目标SDK最大。安装一个M设备上的22和所有的权限被拒绝 - >使用新的权限模型更新的应用程序


  3. A M设备上安装与目标SDK应用程序23


  4. 应用与目标SDK 22或23,并授予所有权限 - >添加另一个组的已授予组权限(read_storage)和新权限的新权限(read_contacts)


  5. 应用与授予目标SDK 23 read_contacts - >从联系人组添加一个权限(write_contacts)



解决方案

使用开发者控制台和beta测试与Android我测试了我自己的方案。这是我的结局。他们中的大多数符合我的期望,但我想要么总结一下。也许这可以帮助有同样的问题,只是想知道,如果它像对你的期望之一。它不声称这是完整的。


  1. 应用与目标SDK最大。安装一个M设备上22,并授予所有权限 - >使用新的权限模型更新的应用程序


    • 与目标SDK 23权限的应用程序更新后仍授予


  2. 应用与目标SDK最大。安装一个M设备上的22和所有的权限被拒绝 - >使用新的权限模型更新的应用程序


    • 与目标SDK 23权限的应用程序更新后,仍然拒绝


  3. A M设备上安装与目标SDK应用程序23


    • 安装无需任何用户交互或通知

    • 所有的权限被拒绝后安装,需要被授予 - >权限对话框出现像实施


  4. 应用与目标SDK 22或23,并授予所有权限 - >添加另一个组的已授予组权限(read_storage)和新权限的新权限(read_contacts)


    • 有write_storage自动授予read_storage(开发者控制台已经为APK的权限信息添加了这个)

    • read_contacts只要求read_contacts(开发者控制台仅显示为APK这个特定的权限)

    • 以前授予的权限都OK,read_contacts需要被授予


  5. 应用与授予目标SDK 23 read_contacts - >从联系人组添加一个权限(write_contacts)


    • 任何特殊处理,允许可在没有任何进一步的用户交互使用

    • 在旧设备(目标最多22个)的用户不被通知关于新的权限,因为他已经授予组权限

    • 在开发者控制台添加write_contacts时允许可见,但没有标记为新的(在APK许可信息)


With Android Marshmallow there is a new permission model. Implementing the new model was not a big deal for my affected app permissions. But there were some question around the install and update behavior. I identified some scenarios which are important for me. I know the official documentation (https://developer.android.com/preview/features/runtime-permissions.html) and some things might be clear, but I wanted to be sure.

  1. App with target SDK max. 22 installed on an M device and all permissions granted -> update app with new permission model

  2. App with target SDK max. 22 installed on an M device and all permissions denied -> update app with new permission model

  3. install app with target SDK 23 on a M device

  4. App with target SDK 22 or 23 and all permissions granted -> add new permission of an already granted group permission (read_storage) and new permission of another group (read_contacts)

  5. App with target SDK 23 and read_contacts granted -> add another permission from contacts group (write_contacts)

解决方案

Using the developer console and beta testing with Android I tested my own scenarios. This is my outcome. Most of them matched my expectations but I want to summarize it either. Maybe this helps one of you having the same questions and just want to know if it behaves like expected. It is not claimed that this is complete.

  1. App with target SDK max. 22 installed on an M device and all permissions granted -> update app with new permission model

    • after app update with target SDK 23 permissions are still granted
  2. App with target SDK max. 22 installed on an M device and all permissions denied -> update app with new permission model

    • after app update with target SDK 23 permissions are still denied
  3. install app with target SDK 23 on a M device

    • installs without any user interaction or notification
    • all permissions are denied after install, need to be granted -> permission dialogs appear like implemented
  4. App with target SDK 22 or 23 and all permissions granted -> add new permission of an already granted group permission (read_storage) and new permission of another group (read_contacts)

    • having write_storage automatically grants read_storage (developer console already added this in the permissions info for the APK)
    • read_contacts only requests read_contacts (developer console only displays this particular permission for the APK)
    • formerly granted permissions are ok, read_contacts needs to be granted
  5. App with target SDK 23 and read_contacts granted -> add another permission from contacts group (write_contacts)

    • no special handling, permission can be used without any further user interaction
    • on older devices (target max 22) the user is not notified about new permission as he already grants the group permission
    • when adding write_contacts in developer console the permission is visible but not marked as new (in permission info of APK)

这篇关于版本的Andr​​oid M允许安装/更新行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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