Android M permission install/update behavior

对着背影说爱祢 提交于 2020-01-02 05:02:36

问题


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)


回答1:


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)


来源:https://stackoverflow.com/questions/32392700/android-m-permission-install-update-behavior

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!