summaryrefslogtreecommitdiffstats
path: root/core/java/android/content/pm
diff options
context:
space:
mode:
authorSvet Ganov <svetoslavganov@google.com>2015-07-03 12:03:02 -0700
committerSvet Ganov <svetoslavganov@google.com>2015-07-03 12:19:02 -0700
commit77ab6a888afaeb9010c7c3884adcd4819dbcee66 (patch)
treef4379ad665e4ede28892dcc048e917d27de33439 /core/java/android/content/pm
parenta7bdb6c99b7ddb6e17f9c939c138686e0bfdbbc4 (diff)
downloadframeworks_base-77ab6a888afaeb9010c7c3884adcd4819dbcee66.zip
frameworks_base-77ab6a888afaeb9010c7c3884adcd4819dbcee66.tar.gz
frameworks_base-77ab6a888afaeb9010c7c3884adcd4819dbcee66.tar.bz2
Show basic feature warning for default granted permissions
bug:22174223 Change-Id: Ie8209e1f678ac459893151b5125e86eb5025aad8
Diffstat (limited to 'core/java/android/content/pm')
-rw-r--r--core/java/android/content/pm/PackageManager.java32
1 files changed, 26 insertions, 6 deletions
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index dd1c5c2..538007a 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -1924,7 +1924,6 @@ public abstract class PackageManager {
*
* @hide
*/
- @SystemApi
public static final int FLAG_PERMISSION_USER_SET = 1 << 0;
/**
@@ -1934,7 +1933,6 @@ public abstract class PackageManager {
*
* @hide
*/
- @SystemApi
public static final int FLAG_PERMISSION_USER_FIXED = 1 << 1;
/**
@@ -1944,7 +1942,6 @@ public abstract class PackageManager {
*
* @hide
*/
- @SystemApi
public static final int FLAG_PERMISSION_POLICY_FIXED = 1 << 2;
/**
@@ -1957,7 +1954,6 @@ public abstract class PackageManager {
*
* @hide
*/
- @SystemApi
public static final int FLAG_PERMISSION_REVOKE_ON_UPGRADE = 1 << 3;
/**
@@ -1966,9 +1962,19 @@ public abstract class PackageManager {
*
* @hide
*/
- @SystemApi
public static final int FLAG_PERMISSION_SYSTEM_FIXED = 1 << 4;
+
+ /**
+ * Permission flag: The permission is granted by default because it
+ * enables app functionality that is expected to work out-of-the-box
+ * for providing a smooth user experience. For example, the phone app
+ * is expected to have the phone permission.
+ *
+ * @hide
+ */
+ public static final int FLAG_PERMISSION_GRANTED_BY_DEFAULT = 1 << 5;
+
/**
* Mask for all permission flags.
*
@@ -2474,7 +2480,8 @@ public abstract class PackageManager {
FLAG_PERMISSION_USER_FIXED,
FLAG_PERMISSION_POLICY_FIXED,
FLAG_PERMISSION_REVOKE_ON_UPGRADE,
- FLAG_PERMISSION_SYSTEM_FIXED})
+ FLAG_PERMISSION_SYSTEM_FIXED,
+ FLAG_PERMISSION_GRANTED_BY_DEFAULT})
@Retention(RetentionPolicy.SOURCE)
public @interface PermissionFlags {}
@@ -4634,6 +4641,19 @@ public abstract class PackageManager {
}
/** {@hide} */
+ public static String permissionFlagToString(int flag) {
+ switch (flag) {
+ case FLAG_PERMISSION_GRANTED_BY_DEFAULT: return "FLAG_PERMISSION_GRANTED_BY_DEFAULT";
+ case FLAG_PERMISSION_POLICY_FIXED: return "FLAG_PERMISSION_POLICY_FIXED";
+ case FLAG_PERMISSION_SYSTEM_FIXED: return "FLAG_PERMISSION_SYSTEM_FIXED";
+ case FLAG_PERMISSION_USER_SET: return "FLAG_PERMISSION_USER_SET";
+ case FLAG_PERMISSION_REVOKE_ON_UPGRADE: return "FLAG_PERMISSION_REVOKE_ON_UPGRADE";
+ case FLAG_PERMISSION_USER_FIXED: return "FLAG_PERMISSION_USER_FIXED";
+ default: return Integer.toString(flag);
+ }
+ }
+
+ /** {@hide} */
public static class LegacyPackageInstallObserver extends PackageInstallObserver {
private final IPackageInstallObserver mLegacy;