我在我的应用程序中声明了新的权限,一个用于读访问,一个用于写访问。有没有办法写权限可以暗示读权限?这样,如果应用程序请求写入权限,则会自动获得读取权限。
这是我的清单代码:
<permission
android:name="com.example.myapp.permission.CHANGE_MESSAGE"
android:description="@string/permission_change_message"
android:protectionLevel="dangerous" />
<permission
android:name="com.example.myapp.permission.READ_MESSAGE"
android:description="@string/permission_read_message"
android:protectionLevel="normal" />
我想让任何有CHANGE_MESSAGE
权限的应用也可以READ_MESSAGE
获得权限,而无需明确声明READ_MESSAGE
。
答案 0 :(得分:0)
我还没有使用自定义Permission
但是你可以试试这个:
Permission Name One------->Point to one Activity--(m1(),m2(),m3())
Permission Name Two------->Point to Second Activity--(m4(),m5(),m6())
假设我们希望在系统授权Permission
名称一时向用户授予Permission
名称二的权限。然后你可以从Activity
名称一点Permission
内部调用m4(),m5(),m6()。