標籤權限組只是用來組一個或多個許可下的特定類別。從開發者的網站http://developer.android.com/guide/topics/manifest/permission-group-element.html
Declares a name for a logical grouping of related permissions. Individual
permission join the group through the permissionGroup attribute of the
<permission> 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 <permission> element for element for
information on declaring permissions and assigning them to groups.
例如,消息相關的權限,說android.permission.SEND_SMS,RECEIVE_SMS和所有相關的消息下android.permission-group.MESSAGES分組權限有一個共同的圖標。
從android源碼https://github.com/android/platform_frameworks_base/blob/master/core/res/AndroidManifest.xml
<permission-group android:name="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"/>
<!-- Allows an application to monitor incoming SMS messages, to record
or perform processing on them. -->
<permission android:name="android.permission.RECEIVE_SMS"
android:permissionGroup="android.permission-group.MESSAGES"
android:protectionLevel="dangerous"
android:label="@string/permlab_receiveSms"
android:description="@string/permdesc_receiveSms" />
<!-- Allows an application to send SMS messages. -->
<permission android:name="android.permission.SEND_SMS"
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下的權限共同的圖標和名稱,這些權限在您的應用程序使用這些權限。
給
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
在一個示例應用程序看到的結果。這兩個權限將被分組到一個共同的類別中。
成本錢是因爲機器人的:permissionFlags =在SEND_SMS許可 「costsMoney」。因此,權限組僅用於對權限進行分類。它不能用於對一個或多個權限進行分組。
權限組擁有很好的權限列表......但是這個組可能有一些用處。究竟是什麼。僅用於存儲權限? – Shree