PermissionInfopublic class PermissionInfo extends PackageItemInfo implements android.os.ParcelableInformation you can retrieve about a particular security permission
known to the system. This corresponds to information collected from the
AndroidManifest.xml's <permission> tags. |
Fields Summary |
---|
public static final int | PROTECTION_NORMALA normal application value for {@link #protectionLevel}, corresponding
to the normal value of
{@link android.R.attr#protectionLevel}. | public static final int | PROTECTION_DANGEROUSDangerous value for {@link #protectionLevel}, corresponding
to the dangerous value of
{@link android.R.attr#protectionLevel}. | public static final int | PROTECTION_SIGNATURESystem-level value for {@link #protectionLevel}, corresponding
to the signature value of
{@link android.R.attr#protectionLevel}. | public static final int | PROTECTION_SIGNATURE_OR_SYSTEMSystem-level value for {@link #protectionLevel}, corresponding
to the signatureOrSystem value of
{@link android.R.attr#protectionLevel}. | public String | groupThe group this permission is a part of, as per
{@link android.R.attr#permissionGroup}. | public int | descriptionResA string resource identifier (in the package's resources) of this
permission's description. From the "description" attribute or,
if not set, 0. | public CharSequence | nonLocalizedDescriptionThe description string provided in the AndroidManifest file, if any. You
probably don't want to use this, since it will be null if the description
is in a resource. You probably want
{@link PermissionInfo#loadDescription} instead. | public int | protectionLevelThe level of access this permission is protecting, as per
{@link android.R.attr#protectionLevel}. Values may be
{@link #PROTECTION_NORMAL}, {@link #PROTECTION_DANGEROUS}, or
{@link #PROTECTION_SIGNATURE}. | public static final Creator | CREATOR |
Constructors Summary |
---|
public PermissionInfo()
| public PermissionInfo(PermissionInfo orig)
super(orig);
group = orig.group;
descriptionRes = orig.descriptionRes;
protectionLevel = orig.protectionLevel;
nonLocalizedDescription = orig.nonLocalizedDescription;
| private PermissionInfo(android.os.Parcel source)
super(source);
group = source.readString();
descriptionRes = source.readInt();
protectionLevel = source.readInt();
nonLocalizedDescription = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
|
Methods Summary |
---|
public int | describeContents()
return 0;
| public java.lang.CharSequence | loadDescription(PackageManager pm)Retrieve the textual description of this permission. This
will call back on the given PackageManager to load the description from
the application.
if (nonLocalizedDescription != null) {
return nonLocalizedDescription;
}
if (descriptionRes != 0) {
CharSequence label = pm.getText(packageName, descriptionRes, null);
if (label != null) {
return label;
}
}
return null;
| public java.lang.String | toString()
return "PermissionInfo{"
+ Integer.toHexString(System.identityHashCode(this))
+ " " + name + "}";
| public void | writeToParcel(android.os.Parcel dest, int parcelableFlags)
super.writeToParcel(dest, parcelableFlags);
dest.writeString(group);
dest.writeInt(descriptionRes);
dest.writeInt(protectionLevel);
TextUtils.writeToParcel(nonLocalizedDescription, dest, parcelableFlags);
|
|