am 7b3add61: am f368f6b9: am 6ee8a509: am c55c4a28: am b14dc048: Merge "Add new "preinstalled" permission flag." into mnc-dev
* commit '7b3add61c9e47b708725147dffc23d396db37add': Add new "preinstalled" permission flag.
This commit is contained in:
@@ -48,17 +48,25 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
|
||||
public static final int PROTECTION_SIGNATURE = 2;
|
||||
|
||||
/**
|
||||
* System-level value for {@link #protectionLevel}, corresponding
|
||||
* to the <code>signatureOrSystem</code> value of
|
||||
* {@link android.R.attr#protectionLevel}.
|
||||
* @deprecated Use {@link #PROTECTION_SIGNATURE}|{@link #PROTECTION_FLAG_PRIVILEGED}
|
||||
* instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final int PROTECTION_SIGNATURE_OR_SYSTEM = 3;
|
||||
|
||||
/**
|
||||
* Additional flag for {@link #protectionLevel}, corresponding
|
||||
* to the <code>system</code> value of
|
||||
* to the <code>privileged</code> value of
|
||||
* {@link android.R.attr#protectionLevel}.
|
||||
*/
|
||||
public static final int PROTECTION_FLAG_PRIVILEGED = 0x10;
|
||||
|
||||
/**
|
||||
* @deprecated Old name for {@link #PROTECTION_FLAG_PRIVILEGED}, which
|
||||
* is now very confusing because it only applies to privileged apps, not all
|
||||
* apps on the system image.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final int PROTECTION_FLAG_SYSTEM = 0x10;
|
||||
|
||||
/**
|
||||
@@ -96,6 +104,13 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
|
||||
*/
|
||||
public static final int PROTECTION_FLAG_VERIFIER = 0x200;
|
||||
|
||||
/**
|
||||
* Additional flag for {@link #protectionLevel}, corresponding
|
||||
* to the <code>preinstalled</code> value of
|
||||
* {@link android.R.attr#protectionLevel}.
|
||||
*/
|
||||
public static final int PROTECTION_FLAG_PREINSTALLED = 0x400;
|
||||
|
||||
/**
|
||||
* Mask for {@link #protectionLevel}: the basic protection type.
|
||||
*/
|
||||
@@ -161,7 +176,7 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
|
||||
/** @hide */
|
||||
public static int fixProtectionLevel(int level) {
|
||||
if (level == PROTECTION_SIGNATURE_OR_SYSTEM) {
|
||||
level = PROTECTION_SIGNATURE | PROTECTION_FLAG_SYSTEM;
|
||||
level = PROTECTION_SIGNATURE | PROTECTION_FLAG_PRIVILEGED;
|
||||
}
|
||||
return level;
|
||||
}
|
||||
@@ -183,8 +198,8 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
|
||||
protLevel = "signatureOrSystem";
|
||||
break;
|
||||
}
|
||||
if ((level&PermissionInfo.PROTECTION_FLAG_SYSTEM) != 0) {
|
||||
protLevel += "|system";
|
||||
if ((level&PermissionInfo.PROTECTION_FLAG_PRIVILEGED) != 0) {
|
||||
protLevel += "|privileged";
|
||||
}
|
||||
if ((level&PermissionInfo.PROTECTION_FLAG_DEVELOPMENT) != 0) {
|
||||
protLevel += "|development";
|
||||
|
||||
Reference in New Issue
Block a user