Declares a name for a logical grouping of related permissions. Individual
permission join the group through the permissionGroup attribute of the
element. Members of a group are presented together in the
user interface.
Note that this element does not declare a permission itself, only a category in
which permissions can be placed. See the element for element for
information on declaring permissions and assigning them to groups.
例如,消息相关的权限,说android.permission.SEND_SMS,RECEIVE_SMS和所有相关的消息下android.permission-group.MESSAGES分组权限有一个共同的图标。
android:label="@string/permgrouplab_messages"
android:icon="@drawable/perm_group_messages"
android:description="@string/permgroupdesc_messages"
android:permissionGroupFlags="personalInfo"
android:priority="360"/>
android:permissionGroup="android.permission-group.MESSAGES"
android:protectionLevel="dangerous"
android:label="@string/permlab_receiveSms"
android:description="@string/permdesc_receiveSms" />
android:permissionGroup="android.permission-group.MESSAGES"
android:protectionLevel="dangerous"
android:permissionFlags="costsMoney"
android:label="@string/permlab_sendSms"
android:description="@string/permdesc_sendSms" />
这里的AndroidManifest.xml中,将android.permission-group.MESSAGES categorises下的权限共同的图标和名称,这些权限在您的应用程序使用这些权限。
给
在一个示例应用程序看到的结果。这两个权限将被分组到一个共同的类别中。
成本钱是因为机器人的:permissionFlags =在SEND_SMS许可 “costsMoney”。因此,权限组仅用于对权限进行分类。它不能用于对一个或多个权限进行分组。