Merge "Expose removed permissions flag as system API" into nyc-dev
am: 5cd52bee32
* commit '5cd52bee32250e14f5eca14d9e82535a0f2f4f87':
Expose removed permissions flag as system API
This commit is contained in:
@@ -10283,6 +10283,7 @@ package android.content.pm {
|
||||
field public static final android.os.Parcelable.Creator<android.content.pm.PermissionInfo> CREATOR;
|
||||
field public static final int FLAG_COSTS_MONEY = 1; // 0x1
|
||||
field public static final int FLAG_INSTALLED = 1073741824; // 0x40000000
|
||||
field public static final int FLAG_REMOVED = 2; // 0x2
|
||||
field public static final int PROTECTION_DANGEROUS = 1; // 0x1
|
||||
field public static final int PROTECTION_FLAG_APPOP = 64; // 0x40
|
||||
field public static final int PROTECTION_FLAG_DEVELOPMENT = 32; // 0x20
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.content.pm;
|
||||
|
||||
import android.annotation.SystemApi;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
@@ -145,11 +146,12 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
|
||||
public static final int FLAG_COSTS_MONEY = 1<<0;
|
||||
|
||||
/**
|
||||
* Flag for {@link #flags}, corresponding to <code>hidden</code>
|
||||
* Flag for {@link #flags}, corresponding to <code>removed</code>
|
||||
* value of {@link android.R.attr#permissionFlags}.
|
||||
* @hide
|
||||
*/
|
||||
public static final int FLAG_HIDDEN = 1<<1;
|
||||
@SystemApi
|
||||
public static final int FLAG_REMOVED = 1<<1;
|
||||
|
||||
/**
|
||||
* Flag for {@link #flags}, indicating that this permission has been
|
||||
|
||||
@@ -889,77 +889,77 @@
|
||||
<!-- @hide We need to keep this around for backwards compatibility -->
|
||||
<permission android:name="android.permission.READ_PROFILE"
|
||||
android:protectionLevel="normal"
|
||||
android:permissionFlags="hidden"/>
|
||||
android:permissionFlags="removed"/>
|
||||
|
||||
<!-- @hide We need to keep this around for backwards compatibility -->
|
||||
<permission android:name="android.permission.WRITE_PROFILE"
|
||||
android:protectionLevel="normal"
|
||||
android:permissionFlags="hidden"/>
|
||||
android:permissionFlags="removed"/>
|
||||
|
||||
<!-- @hide We need to keep this around for backwards compatibility -->
|
||||
<permission android:name="android.permission.READ_SOCIAL_STREAM"
|
||||
android:protectionLevel="normal"
|
||||
android:permissionFlags="hidden"/>
|
||||
android:permissionFlags="removed"/>
|
||||
|
||||
<!-- @hide We need to keep this around for backwards compatibility -->
|
||||
<permission android:name="android.permission.WRITE_SOCIAL_STREAM"
|
||||
android:protectionLevel="normal"
|
||||
android:permissionFlags="hidden"/>
|
||||
android:permissionFlags="removed"/>
|
||||
|
||||
<!-- @hide We need to keep this around for backwards compatibility -->
|
||||
<permission android:name="android.permission.READ_USER_DICTIONARY"
|
||||
android:protectionLevel="normal"
|
||||
android:permissionFlags="hidden"/>
|
||||
android:permissionFlags="removed"/>
|
||||
|
||||
<!-- @hide We need to keep this around for backwards compatibility -->
|
||||
<permission android:name="android.permission.WRITE_USER_DICTIONARY"
|
||||
android:protectionLevel="normal"
|
||||
android:permissionFlags="hidden"/>
|
||||
android:permissionFlags="removed"/>
|
||||
|
||||
<!-- @hide We need to keep this around for backwards compatibility -->
|
||||
<permission android:name="android.permission.WRITE_SMS"
|
||||
android:protectionLevel="normal"
|
||||
android:permissionFlags="hidden"/>
|
||||
android:permissionFlags="removed"/>
|
||||
|
||||
<!-- @hide We need to keep this around for backwards compatibility -->
|
||||
<permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"
|
||||
android:protectionLevel="normal"
|
||||
android:permissionFlags="hidden"/>
|
||||
android:permissionFlags="removed"/>
|
||||
|
||||
<!-- @hide We need to keep this around for backwards compatibility -->
|
||||
<permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"
|
||||
android:protectionLevel="normal"
|
||||
android:permissionFlags="hidden"/>
|
||||
android:permissionFlags="removed"/>
|
||||
|
||||
<!-- @hide We need to keep this around for backwards compatibility -->
|
||||
<permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"
|
||||
android:protectionLevel="normal"
|
||||
android:permissionFlags="hidden"/>
|
||||
android:permissionFlags="removed"/>
|
||||
|
||||
<!-- @hide We need to keep this around for backwards compatibility -->
|
||||
<permission android:name="android.permission.MANAGE_ACCOUNTS"
|
||||
android:protectionLevel="normal"
|
||||
android:permissionFlags="hidden"/>
|
||||
android:permissionFlags="removed"/>
|
||||
|
||||
<!-- @hide We need to keep this around for backwards compatibility -->
|
||||
<permission android:name="android.permission.USE_CREDENTIALS"
|
||||
android:protectionLevel="normal"
|
||||
android:permissionFlags="hidden"/>
|
||||
android:permissionFlags="removed"/>
|
||||
|
||||
<!-- @hide We need to keep this around for backwards compatibility -->
|
||||
<permission android:name="android.permission.SUBSCRIBED_FEEDS_READ"
|
||||
android:protectionLevel="normal"
|
||||
android:permissionFlags="hidden"/>
|
||||
android:permissionFlags="removed"/>
|
||||
|
||||
<!-- @hide We need to keep this around for backwards compatibility -->
|
||||
<permission android:name="android.permission.SUBSCRIBED_FEEDS_WRITE"
|
||||
android:protectionLevel="normal"
|
||||
android:permissionFlags="hidden"/>
|
||||
android:permissionFlags="removed"/>
|
||||
|
||||
<!-- @hide We need to keep this around for backwards compatibility -->
|
||||
<permission android:name="android.permission.FLASHLIGHT"
|
||||
android:protectionLevel="normal"
|
||||
android:permissionFlags="hidden"/>
|
||||
android:permissionFlags="removed"/>
|
||||
|
||||
<!-- ====================================================================== -->
|
||||
<!-- INSTALL PERMISSIONS -->
|
||||
|
||||
@@ -248,9 +248,12 @@
|
||||
may cost the user money. Such permissions may be highlighted
|
||||
when shown to the user with this additional information. -->
|
||||
<flag name="costsMoney" value="0x0001" />
|
||||
<!-- Additional flag from base permission type: this permission is hidden
|
||||
and should not show in the UI. -->
|
||||
<flag name="hidden" value="0x2" />
|
||||
<!-- Additional flag from base permission type: this permission has been
|
||||
removed and it is no longer enforced. It shouldn't be shown in the
|
||||
UI. Removed permissions are kept as normal permissions for backwards
|
||||
compatibility as apps may be checking them before calling an API.
|
||||
-->
|
||||
<flag name="removed" value="0x2" />
|
||||
</attr>
|
||||
|
||||
<!-- Specified the name of a group that this permission is associated
|
||||
|
||||
@@ -4434,7 +4434,7 @@ final class Settings {
|
||||
if ((perm.info.flags&PermissionInfo.FLAG_COSTS_MONEY) != 0) {
|
||||
pw.print(", COSTS_MONEY");
|
||||
}
|
||||
if ((perm.info.flags&PermissionInfo.FLAG_HIDDEN) != 0) {
|
||||
if ((perm.info.flags&PermissionInfo.FLAG_REMOVED) != 0) {
|
||||
pw.print(", HIDDEN");
|
||||
}
|
||||
if ((perm.info.flags&PermissionInfo.FLAG_INSTALLED) != 0) {
|
||||
@@ -4611,7 +4611,7 @@ final class Settings {
|
||||
if (p.perm != null) {
|
||||
pw.print(" perm="); pw.println(p.perm);
|
||||
if ((p.perm.info.flags & PermissionInfo.FLAG_INSTALLED) == 0
|
||||
|| (p.perm.info.flags & PermissionInfo.FLAG_HIDDEN) != 0) {
|
||||
|| (p.perm.info.flags & PermissionInfo.FLAG_REMOVED) != 0) {
|
||||
pw.print(" flags=0x"); pw.println(Integer.toHexString(p.perm.info.flags));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user