PackageInfo
open class PackageInfo : Parcelable
| kotlin.Any | |
| ↳ | android.content.pm.PackageInfo |
Overall information about the contents of a package. This corresponds to all of the information collected from AndroidManifest.xml.
Summary
| Constants | |
|---|---|
| static Int |
Constant corresponding to |
| static Int |
Constant corresponding to |
| static Int |
Constant corresponding to |
| static Int |
Flag for |
| static Int |
Flag for |
| static Int |
Flag for |
| Inherited constants | |
|---|---|
| Public constructors | |
|---|---|
| Public methods | |
|---|---|
| open Int | |
| open String? |
If the package is an APEX package (i.e. the value of |
| open Long |
Returns the time at which the app was archived for the user. |
| open Long |
Return |
| open Boolean |
Returns the verification status of the App Metadata of the package. |
| open Unit |
setLongVersionCode(longVersionCode: Long)Set the full version code in this PackageInfo, updating |
| open String |
toString() |
| open Unit |
writeToParcel(dest: Parcel, parcelableFlags: Int) |
| Properties | |
|---|---|
| static Parcelable.Creator<PackageInfo!> | |
| Array<ActivityInfo!>? |
Array of all |
| ApplicationInfo? |
Information collected from the <application> tag, or null if there was none. |
| Array<Attribution!>? |
Array of all |
| Int |
The revision number of the base APK for this package, as specified by the <manifest> tag's |
| Array<ConfigurationInfo!>? |
Application specified preferred configuration |
| Array<FeatureGroupInfo!>? |
Groups of features that this application has requested. |
| Long |
The time at which the app was first installed. |
| IntArray? |
All kernel group-IDs that have been assigned to this package. |
| Int |
The install location requested by the package. |
| Array<InstrumentationInfo!>? |
Array of all |
| Boolean |
Whether the package is an APEX package. |
| Long |
The time at which the app was last updated. |
| String |
The name of this package. |
| Array<PermissionInfo!>? |
Array of all |
| Array<ProviderInfo!>? |
Array of all |
| Array<ActivityInfo!>? |
Array of all |
| Array<FeatureInfo!>? |
Features that this application has requested. |
| Array<String!>? |
Array of all |
| IntArray? |
Array of flags of all |
| Array<ServiceInfo!>? |
Array of all |
| String? |
The shared user ID name of this package, as specified by the <manifest> tag's |
| Int |
The shared user ID label of this package, as specified by the <manifest> tag's |
| Array<Signature!>? |
Array of all signatures read from the package file. |
| SigningInfo? |
Signing information read from the package file, potentially including past signing certificates no longer used after signing certificate rotation. |
| Array<String!> |
The names of any installed split APKs for this package. |
| IntArray |
The revision number of any split APKs for this package, as specified by the <manifest> tag's |
| Int | |
| String? |
The version name of this package, as specified by the <manifest> tag's |
Constants
INSTALL_LOCATION_AUTO
static val INSTALL_LOCATION_AUTO: Int
Constant corresponding to auto in the android.R.attr#installLocation attribute.
Value: 0INSTALL_LOCATION_INTERNAL_ONLY
static val INSTALL_LOCATION_INTERNAL_ONLY: Int
Constant corresponding to internalOnly in the android.R.attr#installLocation attribute.
Value: 1INSTALL_LOCATION_PREFER_EXTERNAL
static val INSTALL_LOCATION_PREFER_EXTERNAL: Int
Constant corresponding to preferExternal in the android.R.attr#installLocation attribute.
Value: 2REQUESTED_PERMISSION_GRANTED
static val REQUESTED_PERMISSION_GRANTED: Int
Flag for requestedPermissionsFlags: the requested permission is currently granted to the application.
Value: 2REQUESTED_PERMISSION_IMPLICIT
static val REQUESTED_PERMISSION_IMPLICIT: Int
Flag for requestedPermissionsFlags: the requested permission was not explicitly requested via uses-permission, but was instead implicitly requested (e.g., for version compatibility reasons).
Value: 4REQUESTED_PERMISSION_NEVER_FOR_LOCATION
static val REQUESTED_PERMISSION_NEVER_FOR_LOCATION: Int
Flag for 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 android.Manifest.permission#ACCESS_FINE_LOCATION and/or android.Manifest.permission#ACCESS_COARSE_LOCATION being granted.
Value: 65536Public constructors
Public methods
describeContents
open fun describeContents(): Int
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
getApexPackageName
open fun getApexPackageName(): String?
If the package is an APEX package (i.e. the value of 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.
getArchiveTimeMillis
open fun getArchiveTimeMillis(): Long
Returns the time at which the app was archived for the user. Units are as per System.currentTimeMillis().
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.
| Return | |
|---|---|
Long |
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. |
getLongVersionCode
open fun getLongVersionCode(): Long
Return versionCode and versionCodeMajor combined together as a single long value. The versionCodeMajor is placed in the upper 32 bits.
isAppMetadataVerified
open fun isAppMetadataVerified(): Boolean
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.
setLongVersionCode
open fun setLongVersionCode(longVersionCode: Long): Unit
Set the full version code in this PackageInfo, updating versionCode with the lower bits.
See Also
toString
open fun toString(): String
| Return | |
|---|---|
String |
a string representation of the object. |
writeToParcel
open fun writeToParcel(
dest: Parcel,
parcelableFlags: Int
): Unit
| Parameters | |
|---|---|
dest |
Parcel: The Parcel in which the object should be written. This value cannot be null. |
flags |
Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |
Properties
activities
var activities: Array<ActivityInfo!>?
Array of all <activity> tags included under <application>, or null if there were none. This is only filled in if the flag PackageManager.GET_ACTIVITIES was set.
applicationInfo
var applicationInfo: ApplicationInfo?
Information collected from the <application> tag, or null if there was none.
attributions
var attributions: Array<Attribution!>?
Array of all <attribution> tags included under <manifest>, or null if there were none. This is only filled if the flag PackageManager.GET_ATTRIBUTIONS_LONG was set.
baseRevisionCode
var baseRevisionCode: Int
The revision number of the base APK for this package, as specified by the <manifest> tag's revisionCode attribute.
configPreferences
var configPreferences: Array<ConfigurationInfo!>?
Application specified preferred configuration <uses-configuration> tags included under <manifest>, or null if there were none. This is only filled in if the flag PackageManager.GET_CONFIGURATIONS was set.
featureGroups
var featureGroups: Array<FeatureGroupInfo!>?
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.
firstInstallTime
var firstInstallTime: Long
The time at which the app was first installed. Units are as per System.currentTimeMillis().
gids
var gids: IntArray?
All kernel group-IDs that have been assigned to this package. This is only filled in if the flag PackageManager.GET_GIDS was set.
installLocation
var installLocation: Int
The install location requested by the package. From the android.R.attr#installLocation attribute, one of INSTALL_LOCATION_AUTO, INSTALL_LOCATION_INTERNAL_ONLY, INSTALL_LOCATION_PREFER_EXTERNAL
instrumentation
var instrumentation: Array<InstrumentationInfo!>?
Array of all <instrumentation> tags included under <manifest>, or null if there were none. This is only filled in if the flag PackageManager.GET_INSTRUMENTATION was set.
lastUpdateTime
var lastUpdateTime: Long
The time at which the app was last updated. Units are as per System.currentTimeMillis().
packageName
var packageName: String
The name of this package. From the <manifest> tag's "name" attribute.
permissions
var permissions: Array<PermissionInfo!>?
Array of all <permission> tags included under <manifest>, or null if there were none. This is only filled in if the flag PackageManager.GET_PERMISSIONS was set.
providers
var providers: Array<ProviderInfo!>?
Array of all <provider> tags included under <application>, or null if there were none. This is only filled in if the flag PackageManager.GET_PROVIDERS was set.
receivers
var receivers: Array<ActivityInfo!>?
Array of all <receiver> tags included under <application>, or null if there were none. This is only filled in if the flag PackageManager.GET_RECEIVERS was set.
reqFeatures
var reqFeatures: Array<FeatureInfo!>?
Features that this application has requested.
requestedPermissions
var requestedPermissions: Array<String!>?
Array of all <uses-permission> tags included under <manifest>, or null if there were none. This is only filled in if the flag 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.
requestedPermissionsFlags
var requestedPermissionsFlags: IntArray?
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 PackageManager.GET_PERMISSIONS was set. Each value matches the corresponding entry in requestedPermissions, and will have the flags REQUESTED_PERMISSION_GRANTED, REQUESTED_PERMISSION_IMPLICIT, and REQUESTED_PERMISSION_NEVER_FOR_LOCATION set as appropriate.
services
var services: Array<ServiceInfo!>?
Array of all <service> tags included under <application>, or null if there were none. This is only filled in if the flag PackageManager.GET_SERVICES was set.
sharedUserId
var sharedUserId: String?
The shared user ID name of this package, as specified by the <manifest> tag's sharedUserId attribute.
sharedUserLabel
var sharedUserLabel: Int
The shared user ID label of this package, as specified by the <manifest> tag's sharedUserLabel attribute.
signatures
varsignatures: Array<Signature!>?
Deprecated: use signingInfo instead
Array of all signatures read from the package file. This is only filled in if the flag 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 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.
signingInfo
var 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 PackageManager.GET_SIGNING_CERTIFICATES was set. Use this field instead of the deprecated signatures field. See SigningInfo for more information on its contents.
splitNames
var splitNames: Array<String!>
The names of any installed split APKs for this package.
splitRevisionCodes
var splitRevisionCodes: IntArray
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.
versionCode
varversionCode: Int
Deprecated: Use getLongVersionCode() instead, which includes both this and the additional versionCodeMajor attribute. The version number of this package, as specified by the <manifest> tag's versionCode attribute.
See Also
versionName
var versionName: String?
The version name of this package, as specified by the <manifest> tag's versionName attribute, or null if there was none.