From 2a1376d9dfb362a18ba110d8e172f96021f1d879 Mon Sep 17 00:00:00 2001 From: Svet Ganov Date: Mon, 22 Feb 2016 17:20:35 -0800 Subject: [PATCH] Expose removed permissions flag as system API There are some permissions that were removed from the platform and guard nothing but legacy apps may be checking them before calling APIs. Hence, these apps should get the permissions as expected despite them being a no-op. To address this the platform declares removed permissions as normal permissions that are hidden such that legacy apps can always get them. These permissions are not shown in the UI. Play needs a way to filter out these permissions like the platform as they have permissions UI too. bug:23361760 Change-Id: I10f442dfc09a299ddc5480d8bf2db0bd786aec62 --- api/system-current.txt | 1 + .../android/content/pm/PermissionInfo.java | 6 ++-- core/res/AndroidManifest.xml | 30 +++++++++---------- core/res/res/values/attrs_manifest.xml | 9 ++++-- .../java/com/android/server/pm/Settings.java | 12 ++------ 5 files changed, 28 insertions(+), 30 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index ec422c0269506..e580e364290e8 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -10277,6 +10277,7 @@ package android.content.pm { field public static final android.os.Parcelable.Creator 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 diff --git a/core/java/android/content/pm/PermissionInfo.java b/core/java/android/content/pm/PermissionInfo.java index 9da2ba9ce59db..984a960b5308e 100644 --- a/core/java/android/content/pm/PermissionInfo.java +++ b/core/java/android/content/pm/PermissionInfo.java @@ -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 hidden + * Flag for {@link #flags}, corresponding to removed * 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 diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 99daab47bb416..cefe179be2e31 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -866,77 +866,77 @@ + android:permissionFlags="removed"/> + android:permissionFlags="removed"/> + android:permissionFlags="removed"/> + android:permissionFlags="removed"/> + android:permissionFlags="removed"/> + android:permissionFlags="removed"/> + android:permissionFlags="removed"/> + android:permissionFlags="removed"/> + android:permissionFlags="removed"/> + android:permissionFlags="removed"/> + android:permissionFlags="removed"/> + android:permissionFlags="removed"/> + android:permissionFlags="removed"/> + android:permissionFlags="removed"/> + android:permissionFlags="removed"/> diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index 1496d0926dc6d..d9bdb7483eb52 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -248,9 +248,12 @@ may cost the user money. Such permissions may be highlighted when shown to the user with this additional information. --> - - + +