Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/content/pm/PackageInfo#constants) \| [Inherited Constants](https://developer.android.com/reference/android/content/pm/PackageInfo#inhconstants) \| [Fields](https://developer.android.com/reference/android/content/pm/PackageInfo#lfields) \| [Ctors](https://developer.android.com/reference/android/content/pm/PackageInfo#pubctors) \| [Methods](https://developer.android.com/reference/android/content/pm/PackageInfo#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/content/pm/PackageInfo#inhmethods)

# PackageInfo

*** ** * ** ***


`
public


class
PackageInfo
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


implements

https://developer.android.com/reference/android/os/Parcelable


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.content.pm.PackageInfo |

<br />

*** ** * ** ***

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

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/content/pm/PackageInfo#INSTALL_LOCATION_AUTO` Constant corresponding to `auto` in the `https://developer.android.com/reference/android/R.attr#installLocation` attribute. |
| `int` | `https://developer.android.com/reference/android/content/pm/PackageInfo#INSTALL_LOCATION_INTERNAL_ONLY` Constant corresponding to `internalOnly` in the `https://developer.android.com/reference/android/R.attr#installLocation` attribute. |
| `int` | `https://developer.android.com/reference/android/content/pm/PackageInfo#INSTALL_LOCATION_PREFER_EXTERNAL` Constant corresponding to `preferExternal` in the `https://developer.android.com/reference/android/R.attr#installLocation` attribute. |
| `int` | `https://developer.android.com/reference/android/content/pm/PackageInfo#REQUESTED_PERMISSION_GRANTED` Flag for `https://developer.android.com/reference/android/content/pm/PackageInfo#requestedPermissionsFlags`: the requested permission is currently granted to the application. |
| `int` | `https://developer.android.com/reference/android/content/pm/PackageInfo#REQUESTED_PERMISSION_IMPLICIT` Flag for `https://developer.android.com/reference/android/content/pm/PackageInfo#requestedPermissionsFlags`: the requested permission was not explicitly requested via uses-permission, but was instead implicitly requested (e.g., for version compatibility reasons). |
| `int` | `https://developer.android.com/reference/android/content/pm/PackageInfo#REQUESTED_PERMISSION_NEVER_FOR_LOCATION` Flag for `https://developer.android.com/reference/android/content/pm/PackageInfo#requestedPermissionsFlags`: the requested permission has declared `neverForLocation` in their manifest as a strong assertion by a developer that they will never use this permission to derive the physical location of the device, regardless of `https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION` and/or `https://developer.android.com/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION` being granted. |
| `int` | `https://developer.android.com/reference/android/content/pm/PackageInfo#REQUESTED_PERMISSION_ONLY_FOR_LOCATION_BUTTON` Flag for `https://developer.android.com/reference/android/content/pm/PackageInfo#requestedPermissionsFlags`: It only applies to `https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION`. |
| `int` | `https://developer.android.com/reference/android/content/pm/PackageInfo#REQUESTED_PERMISSION_PRIVATE_COMPUTE_CORE_ONLY` Flag for `https://developer.android.com/reference/android/content/pm/PackageInfo#requestedPermissionsFlags`: the requested permission is restricted to the Private Compute Core. |

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that
the Parcelable object's flattened representation includes a file descriptor.


`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written
is a return value, that is the result of a function such as
"`Parcelable someFunction()`",
"`void someFunction(out Parcelable)`", or
"`void someFunction(inout Parcelable)`".


| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/content/pm/PackageInfo>` | `https://developer.android.com/reference/android/content/pm/PackageInfo#CREATOR` |
| ` public https://developer.android.com/reference/android/content/pm/ActivityInfo` | `https://developer.android.com/reference/android/content/pm/PackageInfo#activities` Array of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestActivity` tags included under \<application\>, or null if there were none. |
| ` public https://developer.android.com/reference/android/content/pm/ApplicationInfo` | `https://developer.android.com/reference/android/content/pm/PackageInfo#applicationInfo` Information collected from the \<application\> tag, or null if there was none. |
| ` public https://developer.android.com/reference/android/content/pm/Attribution` | `https://developer.android.com/reference/android/content/pm/PackageInfo#attributions` Array of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestAttribution` tags included under \<manifest\>, or null if there were none. |
| ` public int` | `https://developer.android.com/reference/android/content/pm/PackageInfo#baseRevisionCode` The revision number of the base APK for this package, as specified by the \<manifest\> tag's `https://developer.android.com/reference/android/R.styleable#AndroidManifest_revisionCode` attribute. |
| ` public https://developer.android.com/reference/android/content/pm/ConfigurationInfo` | `https://developer.android.com/reference/android/content/pm/PackageInfo#configPreferences` Application specified preferred configuration `https://developer.android.com/reference/android/R.styleable#AndroidManifestUsesConfiguration` tags included under \<manifest\>, or null if there were none. |
| ` public https://developer.android.com/reference/android/content/pm/FeatureGroupInfo` | `https://developer.android.com/reference/android/content/pm/PackageInfo#featureGroups` Groups of features that this application has requested. |
| ` public long` | `https://developer.android.com/reference/android/content/pm/PackageInfo#firstInstallTime` The time at which the app was first installed. |
| ` public int[]` | `https://developer.android.com/reference/android/content/pm/PackageInfo#gids` All kernel group-IDs that have been assigned to this package. |
| ` public int` | `https://developer.android.com/reference/android/content/pm/PackageInfo#installLocation` The install location requested by the package. |
| ` public https://developer.android.com/reference/android/content/pm/InstrumentationInfo` | `https://developer.android.com/reference/android/content/pm/PackageInfo#instrumentation` Array of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestInstrumentation` tags included under \<manifest\>, or null if there were none. |
| ` public boolean` | `https://developer.android.com/reference/android/content/pm/PackageInfo#isApex` Whether the package is an APEX package. |
| ` public long` | `https://developer.android.com/reference/android/content/pm/PackageInfo#lastUpdateTime` The time at which the app was last updated. |
| ` public https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/content/pm/PackageInfo#packageName` The name of this package. |
| ` public https://developer.android.com/reference/android/content/pm/PermissionInfo` | `https://developer.android.com/reference/android/content/pm/PackageInfo#permissions` Array of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestPermission` tags included under \<manifest\>, or null if there were none. |
| ` public https://developer.android.com/reference/android/content/pm/ProviderInfo` | `https://developer.android.com/reference/android/content/pm/PackageInfo#providers` Array of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestProvider` tags included under \<application\>, or null if there were none. |
| ` public https://developer.android.com/reference/android/content/pm/ActivityInfo` | `https://developer.android.com/reference/android/content/pm/PackageInfo#receivers` Array of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestReceiver` tags included under \<application\>, or null if there were none. |
| ` public https://developer.android.com/reference/android/content/pm/FeatureInfo` | `https://developer.android.com/reference/android/content/pm/PackageInfo#reqFeatures` Features that this application has requested. |
| ` public https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/content/pm/PackageInfo#requestedPermissions` Array of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestUsesPermission` tags included under \<manifest\>, or null if there were none. |
| ` public int[]` | `https://developer.android.com/reference/android/content/pm/PackageInfo#requestedPermissionsFlags` Array of flags of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestUsesPermission` tags included under \<manifest\>, or null if there were none. |
| ` public https://developer.android.com/reference/android/content/pm/ServiceInfo` | `https://developer.android.com/reference/android/content/pm/PackageInfo#services` Array of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestService` tags included under \<application\>, or null if there were none. |
| ` public https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/content/pm/PackageInfo#sharedUserId` The shared user ID name of this package, as specified by the \<manifest\> tag's `https://developer.android.com/reference/android/R.styleable#AndroidManifest_sharedUserId` attribute. |
| ` public int` | `https://developer.android.com/reference/android/content/pm/PackageInfo#sharedUserLabel` The shared user ID label of this package, as specified by the \<manifest\> tag's `https://developer.android.com/reference/android/R.styleable#AndroidManifest_sharedUserLabel` attribute. |
| ` public https://developer.android.com/reference/android/content/pm/Signature` | `https://developer.android.com/reference/android/content/pm/PackageInfo#signatures` *This field was deprecated in API level 28. use `signingInfo` instead* |
| ` public https://developer.android.com/reference/android/content/pm/SigningInfo` | `https://developer.android.com/reference/android/content/pm/PackageInfo#signingInfo` Signing information read from the package file, potentially including past signing certificates no longer used after signing certificate rotation. |
| ` public https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/content/pm/PackageInfo#splitNames` The names of any installed split APKs for this package. |
| ` public int[]` | `https://developer.android.com/reference/android/content/pm/PackageInfo#splitRevisionCodes` The revision number of any split APKs for this package, as specified by the \<manifest\> tag's `https://developer.android.com/reference/android/R.styleable#AndroidManifest_revisionCode` attribute. |
| ` public int` | `https://developer.android.com/reference/android/content/pm/PackageInfo#versionCode` *This field was deprecated in API level 28. Use `https://developer.android.com/reference/android/content/pm/PackageInfo#getLongVersionCode()` instead, which includes both this and the additional `https://developer.android.com/reference/android/R.styleable#AndroidManifest_versionCodeMajor` attribute. The version number of this package, as specified by the \<manifest\> tag's `https://developer.android.com/reference/android/R.styleable#AndroidManifest_versionCode` attribute.* |
| ` public https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/content/pm/PackageInfo#versionName` The version name of this package, as specified by the \<manifest\> tag's `https://developer.android.com/reference/android/R.styleable#AndroidManifest_versionName` attribute, or null if there was none. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/content/pm/PackageInfo#PackageInfo()() ` |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/content/pm/PackageInfo#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/pm/PackageInfo#getApexPackageName()() ` If the package is an APEX package (i.e. |
| ` long` | ` https://developer.android.com/reference/android/content/pm/PackageInfo#getArchiveTimeMillis()() ` Returns the time at which the app was archived for the user. |
| ` long` | ` https://developer.android.com/reference/android/content/pm/PackageInfo#getLongVersionCode()() ` Return `https://developer.android.com/reference/android/R.styleable#AndroidManifest_versionCode` and `https://developer.android.com/reference/android/R.styleable#AndroidManifest_versionCodeMajor` combined together as a single long value. |
| ` boolean` | ` https://developer.android.com/reference/android/content/pm/PackageInfo#isAppMetadataVerified()() ` Returns the verification status of the App Metadata of the package. |
| ` void` | ` https://developer.android.com/reference/android/content/pm/PackageInfo#setLongVersionCode(long)(long longVersionCode) ` Set the full version code in this PackageInfo, updating `https://developer.android.com/reference/android/content/pm/PackageInfo#versionCode` with the lower bits. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/pm/PackageInfo#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/content/pm/PackageInfo#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int parcelableFlags) ` Flatten this object in to a Parcel. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


From interface `

https://developer.android.com/reference/android/os/Parcelable

` `
abstract


int` `
https://developer.android.com/reference/android/os/Parcelable#describeContents()()
`

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


`
abstract


void` `
https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags)
`

Flatten this object in to a Parcel.


## Constants

### INSTALL_LOCATION_AUTO

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int INSTALL_LOCATION_AUTO
```

Constant corresponding to `auto` in the
`https://developer.android.com/reference/android/R.attr#installLocation` attribute.

<br />

Constant Value:

0
(0x00000000)


### INSTALL_LOCATION_INTERNAL_ONLY

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int INSTALL_LOCATION_INTERNAL_ONLY
```

Constant corresponding to `internalOnly` in the
`https://developer.android.com/reference/android/R.attr#installLocation` attribute.

<br />

Constant Value:

1
(0x00000001)


### INSTALL_LOCATION_PREFER_EXTERNAL

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int INSTALL_LOCATION_PREFER_EXTERNAL
```

Constant corresponding to `preferExternal` in the
`https://developer.android.com/reference/android/R.attr#installLocation` attribute.

<br />

Constant Value:

2
(0x00000002)


### REQUESTED_PERMISSION_GRANTED

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int REQUESTED_PERMISSION_GRANTED
```

Flag for `https://developer.android.com/reference/android/content/pm/PackageInfo#requestedPermissionsFlags`: the requested permission
is currently granted to the application.

<br />

Constant Value:

2
(0x00000002)


### REQUESTED_PERMISSION_IMPLICIT

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int REQUESTED_PERMISSION_IMPLICIT
```

Flag for `https://developer.android.com/reference/android/content/pm/PackageInfo#requestedPermissionsFlags`: the requested permission was
not explicitly requested via uses-permission, but was instead implicitly
requested (e.g., for version compatibility reasons).

<br />

Constant Value:

4
(0x00000004)


### REQUESTED_PERMISSION_NEVER_FOR_LOCATION

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int REQUESTED_PERMISSION_NEVER_FOR_LOCATION
```

Flag for `https://developer.android.com/reference/android/content/pm/PackageInfo#requestedPermissionsFlags`: the requested permission has
declared `neverForLocation` in their manifest as a strong assertion
by a developer that they will never use this permission to derive the
physical location of the device, regardless of
`https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION` and/or
`https://developer.android.com/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION` being granted.

<br />

Constant Value:

65536
(0x00010000)


### REQUESTED_PERMISSION_ONLY_FOR_LOCATION_BUTTON

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int REQUESTED_PERMISSION_ONLY_FOR_LOCATION_BUTTON
```

Flag for `https://developer.android.com/reference/android/content/pm/PackageInfo#requestedPermissionsFlags`: It only applies to `https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION`. When this flag is set, apps cannot request
that permission through `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`, and can only use
location button to obtain it temporarily.

<br />

Constant Value:

131072
(0x00020000)


### REQUESTED_PERMISSION_PRIVATE_COMPUTE_CORE_ONLY

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int REQUESTED_PERMISSION_PRIVATE_COMPUTE_CORE_ONLY
```

Flag for `https://developer.android.com/reference/android/content/pm/PackageInfo#requestedPermissionsFlags`: the requested permission is restricted to the
Private Compute Core.

<br />

Constant Value:

262144
(0x00040000)


## Fields

### CREATOR

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<PackageInfo> CREATOR
```

<br />

<br />

### activities

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ActivityInfo[] activities
```

Array of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestActivity` tags included under \<application\>,
or null if there were none. This is only filled in if the flag
`https://developer.android.com/reference/android/content/pm/PackageManager#GET_ACTIVITIES` was set.

<br />

### applicationInfo

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ApplicationInfo applicationInfo
```

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

<br />

### attributions

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Attribution[] attributions
```

Array of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestAttribution` tags included under \<manifest\>, or null if there were none. This
is only filled if the flag `https://developer.android.com/reference/android/content/pm/PackageManager#GET_ATTRIBUTIONS_LONG` was set.

<br />

### baseRevisionCode

Added in [API level 22](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int baseRevisionCode
```

The revision number of the base APK for this package, as specified by the
\<manifest\> tag's
`https://developer.android.com/reference/android/R.styleable#AndroidManifest_revisionCode`
attribute.

<br />

### configPreferences

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ConfigurationInfo[] configPreferences
```

Application specified preferred configuration
`https://developer.android.com/reference/android/R.styleable#AndroidManifestUsesConfiguration` tags included under \<manifest\>,
or null if there were none. This is only filled in if the flag
`https://developer.android.com/reference/android/content/pm/PackageManager#GET_CONFIGURATIONS` was set.

<br />

### featureGroups

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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 `https://developer.android.com/reference/android/content/pm/PackageInfo#reqFeatures` and one
or more FeatureGroups in order to have satisfied the feature requirement.

<br />

**See also:**

- `https://developer.android.com/reference/android/content/pm/FeatureInfo#FLAG_REQUIRED`

### firstInstallTime

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long firstInstallTime
```

The time at which the app was first installed. Units are as
per `https://developer.android.com/reference/java/lang/System#currentTimeMillis()`.

<br />

### gids

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int[] gids
```

All kernel group-IDs that have been assigned to this package.
This is only filled in if the flag `https://developer.android.com/reference/android/content/pm/PackageManager#GET_GIDS` was set.

<br />

### installLocation

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int installLocation
```

The install location requested by the package. From the
`https://developer.android.com/reference/android/R.attr#installLocation` attribute, one of
`https://developer.android.com/reference/android/content/pm/PackageInfo#INSTALL_LOCATION_AUTO`, `https://developer.android.com/reference/android/content/pm/PackageInfo#INSTALL_LOCATION_INTERNAL_ONLY`,
`https://developer.android.com/reference/android/content/pm/PackageInfo#INSTALL_LOCATION_PREFER_EXTERNAL`

<br />

### instrumentation

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public InstrumentationInfo[] instrumentation
```

Array of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestInstrumentation` tags included under \<manifest\>,
or null if there were none. This is only filled in if the flag
`https://developer.android.com/reference/android/content/pm/PackageManager#GET_INSTRUMENTATION` was set.

<br />

### isApex

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isApex
```

Whether the package is an APEX package.

<br />

### lastUpdateTime

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long lastUpdateTime
```

The time at which the app was last updated. Units are as
per `https://developer.android.com/reference/java/lang/System#currentTimeMillis()`.

<br />

### packageName

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String packageName
```

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

<br />

### permissions

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PermissionInfo[] permissions
```

Array of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestPermission` tags included under \<manifest\>,
or null if there were none. This is only filled in if the flag
`https://developer.android.com/reference/android/content/pm/PackageManager#GET_PERMISSIONS` was set.

<br />

### providers

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ProviderInfo[] providers
```

Array of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestProvider` tags included under \<application\>,
or null if there were none. This is only filled in if the flag
`https://developer.android.com/reference/android/content/pm/PackageManager#GET_PROVIDERS` was set.

<br />

### receivers

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ActivityInfo[] receivers
```

Array of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestReceiver` tags included under \<application\>,
or null if there were none. This is only filled in if the flag
`https://developer.android.com/reference/android/content/pm/PackageManager#GET_RECEIVERS` was set.

<br />

### reqFeatures

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public FeatureInfo[] reqFeatures
```

Features that this application has requested.

<br />

**See also:**

- `https://developer.android.com/reference/android/content/pm/FeatureInfo#FLAG_REQUIRED`

### requestedPermissions

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] requestedPermissions
```

Array of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestUsesPermission` tags included under \<manifest\>,
or null if there were none. This is only filled in if the flag
`https://developer.android.com/reference/android/content/pm/PackageManager#GET_PERMISSIONS` was set. This list includes
all permissions requested, even those that were not granted or known
by the system at install time.

<br />

### requestedPermissionsFlags

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int[] requestedPermissionsFlags
```

Array of flags of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestUsesPermission` tags included under \<manifest\>,
or null if there were none. This is only filled in if the flag
`https://developer.android.com/reference/android/content/pm/PackageManager#GET_PERMISSIONS` was set. Each value matches
the corresponding entry in `https://developer.android.com/reference/android/content/pm/PackageInfo#requestedPermissions`, and will have
the flags `https://developer.android.com/reference/android/content/pm/PackageInfo#REQUESTED_PERMISSION_GRANTED`, `https://developer.android.com/reference/android/content/pm/PackageInfo#REQUESTED_PERMISSION_IMPLICIT`, and
`https://developer.android.com/reference/android/content/pm/PackageInfo#REQUESTED_PERMISSION_NEVER_FOR_LOCATION` set as appropriate.

<br />

### services

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ServiceInfo[] services
```

Array of all `https://developer.android.com/reference/android/R.styleable#AndroidManifestService` tags included under \<application\>,
or null if there were none. This is only filled in if the flag
`https://developer.android.com/reference/android/content/pm/PackageManager#GET_SERVICES` was set.

<br />

### sharedUserId

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String sharedUserId
```

The shared user ID name of this package, as specified by the \<manifest\>
tag's `https://developer.android.com/reference/android/R.styleable#AndroidManifest_sharedUserId`
attribute.

<br />

### sharedUserLabel

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int sharedUserLabel
```

The shared user ID label of this package, as specified by the \<manifest\>
tag's `https://developer.android.com/reference/android/R.styleable#AndroidManifest_sharedUserLabel`
attribute.

<br />

### signatures

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Signature[] signatures
```


**This field was deprecated
in API level 28.**   

use `signingInfo` instead

Array of all signatures read from the package file. This is only filled
in if the flag `https://developer.android.com/reference/android/content/pm/PackageManager#GET_SIGNATURES` was set. A package
must be signed with at least one certificate which is at position zero.
The package can be signed with additional certificates which appear as
subsequent entries.

**Note:** Signature ordering is not guaranteed to be
stable which means that a package signed with certificates A and B is
equivalent to being signed with certificates B and A. This means that
in case multiple signatures are reported you cannot assume the one at
the first position to be the same across updates.

**Deprecated** This has been replaced by the
`https://developer.android.com/reference/android/content/pm/PackageInfo#signingInfo` field, which takes into
account signing certificate rotation. For backwards compatibility in
the event of signing certificate rotation, this will return the oldest
reported signing certificate, so that an application will appear to
callers as though no rotation occurred.

<br />

### signingInfo

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SigningInfo signingInfo
```

Signing information read from the package file, potentially
including past signing certificates no longer used after signing
certificate rotation. This is only filled in if
the flag `https://developer.android.com/reference/android/content/pm/PackageManager#GET_SIGNING_CERTIFICATES` was set.

Use this field instead of the deprecated `signatures` field.
See `https://developer.android.com/reference/android/content/pm/SigningInfo` for more information on its contents.

<br />

### splitNames

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] splitNames
```

The names of any installed split APKs for this package.

<br />

### splitRevisionCodes

Added in [API level 22](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int[] splitRevisionCodes
```

The revision number of any split APKs for this package, as specified by
the \<manifest\> tag's
`https://developer.android.com/reference/android/R.styleable#AndroidManifest_revisionCode`
attribute. Indexes are a 1:1 mapping against `https://developer.android.com/reference/android/content/pm/PackageInfo#splitNames`.

<br />

### versionCode

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int versionCode
```


**This field was deprecated
in API level 28.**   

Use `https://developer.android.com/reference/android/content/pm/PackageInfo#getLongVersionCode()` instead, which includes both
this and the additional
`https://developer.android.com/reference/android/R.styleable#AndroidManifest_versionCodeMajor` attribute.
The version number of this package, as specified by the \<manifest\>
tag's `https://developer.android.com/reference/android/R.styleable#AndroidManifest_versionCode`
attribute.

<br />

<br />

**See also:**

- `https://developer.android.com/reference/android/content/pm/PackageInfo#getLongVersionCode()`

### versionName

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String versionName
```

The version name of this package, as specified by the \<manifest\>
tag's `https://developer.android.com/reference/android/R.styleable#AndroidManifest_versionName`
attribute, or null if there was none.

<br />

## Public constructors

### PackageInfo

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PackageInfo ()
```

<br />

<br />

## Public methods

### describeContents

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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 `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`,
the return value of this method must include the
`https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getApexPackageName

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getApexPackageName ()
```

If the package is an APEX package (i.e. the value of `https://developer.android.com/reference/android/content/pm/PackageInfo#isApex`
is true), returns the package name of the APEX. If the package
is one APK-in-APEX app, returns the package name of the parent
APEX that contains the app. If the package is not one of the above
two cases, returns `null`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getArchiveTimeMillis

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getArchiveTimeMillis ()
```

Returns the time at which the app was archived for the user. Units are as
per `https://developer.android.com/reference/java/lang/System#currentTimeMillis()`.


Value is a non-negative timestamp measured as the number of
milliseconds since 1970-01-01T00:00:00Z.

<br />

| Returns ||
|---|---|
| `long` | Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. <br /> |

### getLongVersionCode

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getLongVersionCode ()
```

Return `https://developer.android.com/reference/android/R.styleable#AndroidManifest_versionCode` and
`https://developer.android.com/reference/android/R.styleable#AndroidManifest_versionCodeMajor` combined
together as a single long value. The
`https://developer.android.com/reference/android/R.styleable#AndroidManifest_versionCodeMajor` is placed in
the upper 32 bits.

<br />

| Returns ||
|---|---|
| `long` | <br /> |

### isAppMetadataVerified

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public boolean isAppMetadataVerified ()
```

Returns the verification status of the App Metadata of the package. This status is set at the
package installation time by the developer verification service provider.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### setLongVersionCode

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setLongVersionCode (long longVersionCode)
```

Set the full version code in this PackageInfo, updating `https://developer.android.com/reference/android/content/pm/PackageInfo#versionCode`
with the lower bits.

<br />

| Parameters ||
|---|---|
| `longVersionCode` | `long` <br /> |

**See also:**

- `https://developer.android.com/reference/android/content/pm/PackageInfo#getLongVersionCode()`

### toString

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

### writeToParcel

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel dest, 
                int parcelableFlags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `parcelableFlags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |