public class PackageInfo
extends Object
implements Parcelable
java.lang.Object | |
↳ | android.content.pm.PackageInfo |
Overall information about the contents of a package. This corresponds to all of the information collected from AndroidManifest.xml.
Constants |
|
---|---|
int |
INSTALL_LOCATION_AUTO Constant corresponding to |
int |
INSTALL_LOCATION_INTERNAL_ONLY Constant corresponding to |
int |
INSTALL_LOCATION_PREFER_EXTERNAL Constant corresponding to |
int |
REQUESTED_PERMISSION_GRANTED Flag for |
Inherited constants |
---|
![]() android.os.Parcelable
|
Fields |
|
---|---|
public static final Creator<PackageInfo> |
CREATOR
|
public ActivityInfo[] |
activities Array of all |
public ApplicationInfo |
applicationInfo Information collected from the <application> tag, or null if there was none. |
public int |
baseRevisionCode The revision number of the base APK for this package, as specified by the <manifest> tag's |
public ConfigurationInfo[] |
configPreferences Application specified preferred configuration |
public FeatureGroupInfo[] |
featureGroups Groups of features that this application has requested. |
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 int |
installLocation The install location requested by the package. |
public InstrumentationInfo[] |
instrumentation Array of all |
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 |
public ProviderInfo[] |
providers Array of all |
public ActivityInfo[] |
receivers Array of all |
public FeatureInfo[] |
reqFeatures Features that this application has requested. |
public String[] |
requestedPermissions Array of all |
public int[] |
requestedPermissionsFlags Array of flags of all |
public ServiceInfo[] |
services Array of all |
public String |
sharedUserId The shared user ID name of this package, as specified by the <manifest> tag's |
public int |
sharedUserLabel The shared user ID label of this package, as specified by the <manifest> tag's |
public Signature[] |
signatures Array of all signatures read from the package file. |
public String[] |
splitNames The names of any installed split APKs for this package. |
public int[] |
splitRevisionCodes The revision number of any split APKs for this package, as specified by the <manifest> tag's |
public int |
versionCode The version number of this package, as specified by the <manifest> tag's |
public String |
versionName The version name of this package, as specified by the <manifest> tag's |
Public constructors |
|
---|---|
PackageInfo() |
Public methods |
|
---|---|
int |
describeContents() Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
String |
toString() Returns a string representation of the object. |
void |
writeToParcel(Parcel dest, int parcelableFlags) Flatten this object in to a Parcel. |
Inherited methods |
|
---|---|
![]() java.lang.Object
|
|
![]() android.os.Parcelable
|
int INSTALL_LOCATION_AUTO
Constant corresponding to auto
in the installLocation
attribute.
Constant Value: 0 (0x00000000)
int INSTALL_LOCATION_INTERNAL_ONLY
Constant corresponding to internalOnly
in the installLocation
attribute.
Constant Value: 1 (0x00000001)
int INSTALL_LOCATION_PREFER_EXTERNAL
Constant corresponding to preferExternal
in the installLocation
attribute.
Constant Value: 2 (0x00000002)
int REQUESTED_PERMISSION_GRANTED
Flag for requestedPermissionsFlags
: the requested permission is currently granted to the application.
Constant Value: 2 (0x00000002)
ActivityInfo[] activities
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.
ApplicationInfo applicationInfo
Information collected from the <application> tag, or null if there was none.
int baseRevisionCode
The revision number of the base APK for this package, as specified by the <manifest> tag's revisionCode
attribute.
ConfigurationInfo[] configPreferences
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.
FeatureGroupInfo[] featureGroups
Groups of features that this application has requested. Each group contains a set of features that are required. A device must match the features listed in reqFeatures
and one or more FeatureGroups in order to have satisfied the feature requirement.
See also:
long firstInstallTime
The time at which the app was first installed. Units are as per currentTimeMillis()
.
int[] gids
All kernel group-IDs that have been assigned to this package. This is only filled in if the flag GET_GIDS
was set.
int installLocation
The install location requested by the package. From the installLocation
attribute, one of INSTALL_LOCATION_AUTO
, INSTALL_LOCATION_INTERNAL_ONLY
, INSTALL_LOCATION_PREFER_EXTERNAL
InstrumentationInfo[] instrumentation
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.
long lastUpdateTime
The time at which the app was last updated. Units are as per currentTimeMillis()
.
String packageName
The name of this package. From the <manifest> tag's "name" attribute.
PermissionInfo[] permissions
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.
ProviderInfo[] providers
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.
ActivityInfo[] receivers
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.
FeatureInfo[] reqFeatures
Features that this application has requested.
See also:
String[] requestedPermissions
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.
int[] requestedPermissionsFlags
Array of flags 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. Each value matches the corresponding entry in requestedPermissions
, and will have the flag REQUESTED_PERMISSION_GRANTED
set as appropriate.
ServiceInfo[] services
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.
String sharedUserId
The shared user ID name of this package, as specified by the <manifest> tag's sharedUserId
attribute.
int sharedUserLabel
The shared user ID label of this package, as specified by the <manifest> tag's sharedUserLabel
attribute.
Signature[] signatures
Array of all signatures read from the package file. This is only filled in if the flag GET_SIGNATURES
was set.
String[] splitNames
The names of any installed split APKs for this package.
int[] splitRevisionCodes
The revision number of any split APKs for this package, as specified by the <manifest> tag's revisionCode
attribute. Indexes are a 1:1 mapping against splitNames
.
int versionCode
The version number of this package, as specified by the <manifest> tag's versionCode
attribute.
String versionName
The version name of this package, as specified by the <manifest> tag's versionName
attribute.
int describeContents ()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel, int)
, the return value of this method must include the CONTENTS_FILE_DESCRIPTOR
bit.
Returns | |
---|---|
int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. |
String toString ()
Returns a string representation of the object. In general, the toString
method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@
', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
Returns | |
---|---|
String |
a string representation of the object. |
void writeToParcel (Parcel dest, int parcelableFlags)
Flatten this object in to a Parcel.
Parameters | |
---|---|
dest |
Parcel : The Parcel in which the object should be written. |
parcelableFlags |
int : Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE . |