AOSP Marshmallow modify/set default permission

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 05:13:57

问题


I have built my own AOSP Marshmallow on my Nexus 5 device and got trouble with the permissions. If I add a new permission into the AndroidManifest.xml of an existing application, this permission will be by default turned off. I have to manually set it. The other permission for example Contacts is being active (the once I did not modify and seems to be standard even after factory reset). So there has to be a file which gives conclusion about the standard permission of the applications. I just could find some files within /system/etc/default-permissions, but this makes no sense to me and it seems to be ignored.

When I add my custom application all permissions are by default turned off. How can I enable those permissions by default when I flash my custom os in Marshmallow for nexus 5 devices? Where can I set this information within my AOSP project? I could set it via pm grant <app> android.permission... but this is not my use case!


回答1:


Default permissions in AOSP are set in this java class: frameworks/base/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java

Here is an example: https://github.com/ProjectDisco/android_frameworks_base/commit/da1408d4a3df46af11854bf68844be133c5a20d3



来源:https://stackoverflow.com/questions/45220411/aosp-marshmallow-modify-set-default-permission

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