AOSP棉花糖修改/设置默认权限 [英] AOSP Marshmallow modify/set default permission

查看:271
本文介绍了AOSP棉花糖修改/设置默认权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Nexus 5设备上构建了自己的AOSP棉花糖,但权限出现问题.如果我将新权限添加到现有应用程序的AndroidManifest.xml中,则默认情况下将禁用此权限.我必须手动设置它.其他权限(例如联系人")正在激活(我没有修改过的权限,即使恢复出厂设置后,它似乎也是标准的).因此,必须有一个文件可以得出有关应用程序标准许可权的结论.我只是可以在/system/etc/default-permissions中找到一些文件,但这对我来说毫无意义,而且似乎被忽略了.

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.

当我添加自定义应用程序时,默认情况下所有权限都处于关闭状态.当我在棉花糖中为nexus 5设备刷新自定义操作系统时,如何默认启用这些权限?在我的AOSP项目中可以在哪里设置此信息?我可以通过pm grant <app> android.permission进行设置...但这不是我的用例!

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!

推荐答案

在以下Java类中设置了AOSP中的默认权限:frameworks/base/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java

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

这里是一个示例: https://github.com/ProjectDisco/android_frameworks_base/commit/da1408d4a3df46af11854bf68844be133c5a20d3

这篇关于AOSP棉花糖修改/设置默认权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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