public class

PackageInfo

extends Object
implements Parcelable
java.lang.Object
   ↳ android.content.pm.PackageInfo

Class Overview

Overall information about the contents of a package. This corresponds to all of the information collected from AndroidManifest.xml.

Summary

Constants
Creator<PackageInfo> CREATOR
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public ActivityInfo[] activities Array of all <activity> tags included under <application>, or null if there were none.
public ApplicationInfo applicationInfo Information collected from the <application> tag, or null if there was none.
public ConfigurationInfo[] configPreferences Application specified preferred configuration <uses-configuration> tags included under <manifest>, or null if there were none.
public long firstInstallTime The time at which the app was first installed.
public int[] gids All kernel group-IDs that have been assigned to this package.
public InstrumentationInfo[] instrumentation Array of all <instrumentation> tags included under <manifest>, or null if there were none.
public long lastUpdateTime The time at which the app was last updated.
public String packageName The name of this package.
public PermissionInfo[] permissions Array of all <permission> tags included under <manifest>, or null if there were none.
public ProviderInfo[] providers Array of all <provider> tags included under <application>, or null if there were none.
public ActivityInfo[] receivers Array of all <receiver> tags included under <application>, or null if there were none.
public FeatureInfo[] reqFeatures The features that this application has said it requires.
public String[] requestedPermissions Array of all <uses-permission> tags included under <manifest>, or null if there were none.
public ServiceInfo[] services Array of all <service> tags included under <application>, or null if there were none.
public String sharedUserId The shared user ID name of this package, as specified by the <manifest> tag's sharedUserId attribute.
public int sharedUserLabel The shared user ID label of this package, as specified by the <manifest> tag's sharedUserLabel attribute.
public Signature[] signatures Array of all signatures read from the package file.
public int versionCode The version number of this package, as specified by the <manifest> tag's versionCode attribute.
public String versionName The version name of this package, as specified by the <manifest> tag's versionName attribute.
Public Constructors
PackageInfo()
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel dest, int parcelableFlags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final Creator<PackageInfo> CREATOR

Since: API Level 1

Fields

public ActivityInfo[] activities

Since: API Level 1

Array of all <activity> tags included under <application>, or null if there were none. This is only filled in if the flag GET_ACTIVITIES was set.

public ApplicationInfo applicationInfo

Since: API Level 1

Information collected from the <application> tag, or null if there was none.

public ConfigurationInfo[] configPreferences

Since: API Level 3

Application specified preferred configuration <uses-configuration> tags included under <manifest>, or null if there were none. This is only filled in if the flag GET_CONFIGURATIONS was set.

public long firstInstallTime

Since: API Level 9

The time at which the app was first installed. Units are as per currentTimeMillis().

public int[] gids

Since: API Level 1

All kernel group-IDs that have been assigned to this package. This is only filled in if the flag GET_GIDS was set.

public InstrumentationInfo[] instrumentation

Since: API Level 1

Array of all <instrumentation> tags included under <manifest>, or null if there were none. This is only filled in if the flag GET_INSTRUMENTATION was set.

public long lastUpdateTime

Since: API Level 9

The time at which the app was last updated. Units are as per currentTimeMillis().

public String packageName

Since: API Level 1

The name of this package. From the <manifest> tag's "name" attribute.

public PermissionInfo[] permissions

Since: API Level 1

Array of all <permission> tags included under <manifest>, or null if there were none. This is only filled in if the flag GET_PERMISSIONS was set.

public ProviderInfo[] providers

Since: API Level 1

Array of all <provider> tags included under <application>, or null if there were none. This is only filled in if the flag GET_PROVIDERS was set.

public ActivityInfo[] receivers

Since: API Level 1

Array of all <receiver> tags included under <application>, or null if there were none. This is only filled in if the flag GET_RECEIVERS was set.

public FeatureInfo[] reqFeatures

Since: API Level 5

The features that this application has said it requires.

public String[] requestedPermissions

Since: API Level 1

Array of all <uses-permission> tags included under <manifest>, or null if there were none. This is only filled in if the flag GET_PERMISSIONS was set. This list includes all permissions requested, even those that were not granted or known by the system at install time.

public ServiceInfo[] services

Since: API Level 1

Array of all <service> tags included under <application>, or null if there were none. This is only filled in if the flag GET_SERVICES was set.

public String sharedUserId

Since: API Level 3

The shared user ID name of this package, as specified by the <manifest> tag's sharedUserId attribute.

public int sharedUserLabel

Since: API Level 3

The shared user ID label of this package, as specified by the <manifest> tag's sharedUserLabel attribute.

public Signature[] signatures

Since: API Level 1

Array of all signatures read from the package file. This is only filled in if the flag GET_SIGNATURES was set.

public int versionCode

Since: API Level 1

The version number of this package, as specified by the <manifest> tag's versionCode attribute.

public String versionName

Since: API Level 1

The version name of this package, as specified by the <manifest> tag's versionName attribute.

Public Constructors

public PackageInfo ()

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 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

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
parcelableFlags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.