InstallSourceInfo
class InstallSourceInfo : Parcelable
kotlin.Any | |
↳ | android.content.pm.InstallSourceInfo |
Information about how an app was installed.
Summary
Inherited constants | |
---|---|
Public methods | |
---|---|
Int | |
String? |
The name of the package that requested the installation, or null if not available. |
SigningInfo? |
Information about the signing certificates used to sign the initiating package, if available. |
String? |
The name of the package responsible for the installation (the installer of record), or null if not available. |
String? |
The name of the package on behalf of which the initiating package requested the installation, or null if not available. |
Int |
Information about the package source when installer installed this app. |
String? |
The name of the package that is the update owner, or null if not available. |
Unit |
writeToParcel(dest: Parcel, flags: Int) Flatten this object in to a Parcel. |
Properties | |
---|---|
static Parcelable.Creator<InstallSourceInfo!> |
Public methods
describeContents
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 |
getInitiatingPackageName
fun getInitiatingPackageName(): String?
The name of the package that requested the installation, or null if not available. This is normally the same as the installing package name. If the installing package name is changed, for example by calling PackageManager.setInstallerPackageName(String, String)
, the initiating package name remains unchanged. It continues to identify the actual package that performed the install or update.
Null may be returned if the app was not installed by a package (e.g. a system app) or if the initiating package has itself been uninstalled.
getInitiatingPackageSigningInfo
fun getInitiatingPackageSigningInfo(): SigningInfo?
Information about the signing certificates used to sign the initiating package, if available.
Return | |
---|---|
SigningInfo? |
This value may be null . |
getInstallingPackageName
fun getInstallingPackageName(): String?
The name of the package responsible for the installation (the installer of record), or null if not available. Note that this may differ from the initiating package name and can be modified via PackageManager.setInstallerPackageName(String, String)
.
Null may be returned if the app was not installed by a package (e.g. a system app or an app installed via adb) or if the installing package has itself been uninstalled.
getOriginatingPackageName
fun getOriginatingPackageName(): String?
The name of the package on behalf of which the initiating package requested the installation, or null if not available.
For example if a downloaded APK is installed via the Package Installer this could be the app that performed the download. This value is provided by the initiating package and not verified by the framework.
Note that the InstallSourceInfo
returned by PackageManager.getInstallSourceInfo(String)
will not have this information available unless the calling application holds the INSTALL_PACKAGES permission.
getPackageSource
fun getPackageSource(): Int
Information about the package source when installer installed this app.
getUpdateOwnerPackageName
fun getUpdateOwnerPackageName(): String?
The name of the package that is the update owner, or null if not available. This indicates the update ownership enforcement is enabled for this app, and which package is the update owner. Returns null if the update ownership enforcement is disabled for the app.
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
Parameters | |
---|---|
dest |
Parcel: This value cannot be null . |
flags |
Int: 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 |