public class

PermissionInfo

extends PackageItemInfo
implements Parcelable
java.lang.Object
   ↳ android.content.pm.PackageItemInfo
     ↳ android.content.pm.PermissionInfo

Class Overview

Information you can retrieve about a particular security permission known to the system. This corresponds to information collected from the AndroidManifest.xml's <permission> tags.

Summary

Constants
int PROTECTION_DANGEROUS Dangerous value for protectionLevel, corresponding to the dangerous value of protectionLevel.
int PROTECTION_NORMAL A normal application value for protectionLevel, corresponding to the normal value of protectionLevel.
int PROTECTION_SIGNATURE System-level value for protectionLevel, corresponding to the signature value of protectionLevel.
int PROTECTION_SIGNATURE_OR_SYSTEM System-level value for protectionLevel, corresponding to the signatureOrSystem value of protectionLevel.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<PermissionInfo> CREATOR
public int descriptionRes A string resource identifier (in the package's resources) of this permission's description.
public String group The group this permission is a part of, as per permissionGroup.
public CharSequence nonLocalizedDescription The description string provided in the AndroidManifest file, if any.
public int protectionLevel The level of access this permission is protecting, as per protectionLevel.
[Expand]
Inherited Fields
From class android.content.pm.PackageItemInfo
Public Constructors
PermissionInfo()
PermissionInfo(PermissionInfo orig)
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
CharSequence loadDescription(PackageManager pm)
Retrieve the textual description of this permission.
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel dest, int parcelableFlags)
[Expand]
Inherited Methods
From class android.content.pm.PackageItemInfo
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final int PROTECTION_DANGEROUS

Since: API Level 1

Dangerous value for protectionLevel, corresponding to the dangerous value of protectionLevel.

Constant Value: 1 (0x00000001)

public static final int PROTECTION_NORMAL

Since: API Level 1

A normal application value for protectionLevel, corresponding to the normal value of protectionLevel.

Constant Value: 0 (0x00000000)

public static final int PROTECTION_SIGNATURE

Since: API Level 1

System-level value for protectionLevel, corresponding to the signature value of protectionLevel.

Constant Value: 2 (0x00000002)

public static final int PROTECTION_SIGNATURE_OR_SYSTEM

Since: API Level 1

System-level value for protectionLevel, corresponding to the signatureOrSystem value of protectionLevel.

Constant Value: 3 (0x00000003)

Fields

public static final Creator<PermissionInfo> CREATOR

Since: API Level 1

public int descriptionRes

Since: API Level 1

A string resource identifier (in the package's resources) of this permission's description. From the "description" attribute or, if not set, 0.

public String group

Since: API Level 1

The group this permission is a part of, as per permissionGroup.

public CharSequence nonLocalizedDescription

Since: API Level 1

The 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 loadDescription(PackageManager) instead.

public int protectionLevel

Since: API Level 1

The level of access this permission is protecting, as per protectionLevel. Values may be PROTECTION_NORMAL, PROTECTION_DANGEROUS, or PROTECTION_SIGNATURE.

Public Constructors

public PermissionInfo ()

Since: API Level 1

public PermissionInfo (PermissionInfo orig)

Since: API Level 1

Public Methods

public int describeContents ()

Since: API Level 1

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public CharSequence loadDescription (PackageManager pm)

Since: API Level 1

Retrieve the textual description of this permission. This will call back on the given PackageManager to load the description from the application.

Parameters
pm A PackageManager from which the label can be loaded; usually the PackageManager from which you originally retrieved this item.
Returns
  • Returns a CharSequence containing the permission's description. If there is no description, null is returned.

public String toString ()

Since: API Level 1

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.

public void writeToParcel (Parcel dest, int parcelableFlags)

Since: API Level 1