Added in API level 26

SharedLibraryInfo


class SharedLibraryInfo : Parcelable
kotlin.Any
   ↳ android.content.pm.SharedLibraryInfo

This class provides information for a shared library. There are four types of shared libraries: builtin - non-updatable part of the OS; dynamic - updatable backwards-compatible dynamically linked; static - non backwards-compatible emulating static linking; SDK - updatable backwards-incompatible dynamically loaded.

Summary

Constants
static Int

Shared library type: this library is a part of the OS and cannot be updated or uninstalled.

static Int

Shared library type: this library is backwards-compatible, can be updated, and updates can be uninstalled.

static Int

SDK package shared library type: this library is not compatible between versions, can be updated and updates can be uninstalled.

static Int

Shared library type: this library is not backwards -compatible, can be updated and updates can be uninstalled.

static Int

Constant for referring to an undefined version.

Inherited constants
Public methods
Int

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

MutableList<String!>

Gets the list of certificate digests for the shared library.

VersionedPackage

Gets the package that declares the library.

MutableList<VersionedPackage!>

Gets the packages that depend on the library.

Long

Gets the version of the library.

String!

Gets the library name an app defines in its manifest to depend on the library.

Int

Gets the type of this library.

Int

String

Returns a string representation of the object.

Unit
writeToParcel(parcel: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<SharedLibraryInfo!>

Constants

TYPE_BUILTIN

Added in API level 26
static val TYPE_BUILTIN: Int

Shared library type: this library is a part of the OS and cannot be updated or uninstalled.

Value: 0

TYPE_DYNAMIC

Added in API level 26
static val TYPE_DYNAMIC: Int

Shared library type: this library is backwards-compatible, can be updated, and updates can be uninstalled. Clients link against the latest version of the library.

Value: 1

TYPE_SDK_PACKAGE

Added in API level 33
static val TYPE_SDK_PACKAGE: Int

SDK package shared library type: this library is not compatible between versions, can be updated and updates can be uninstalled. Clients depend on a specific version of the library. SDK packages are not loaded automatically by the OS and rely e.g. on 3P libraries to make them available for the clients.

Value: 3

TYPE_STATIC

Added in API level 26
static val TYPE_STATIC: Int

Shared library type: this library is not backwards -compatible, can be updated and updates can be uninstalled. Clients link against a specific version of the library. Static shared libraries simulate static linking while allowing for multiple clients to reuse the same instance of the library.

Value: 2

VERSION_UNDEFINED

Added in API level 26
static val VERSION_UNDEFINED: Int

Constant for referring to an undefined version.

Value: -1

Public methods

describeContents

Added in API level 26
fun describeContents(): Int

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(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getCertDigests

Added in API level 36
fun getCertDigests(): MutableList<String!>

Gets the list of certificate digests for the shared library.

Return
MutableList<String!> The list of certificate digests.
This value cannot be null.

getDeclaringPackage

Added in API level 26
fun getDeclaringPackage(): VersionedPackage

Gets the package that declares the library.

Return
VersionedPackage The package declaring the library.
This value cannot be null.

getDependentPackages

Added in API level 26
fun getDependentPackages(): MutableList<VersionedPackage!>

Gets the packages that depend on the library. NOTE: the list also contains the result of #getOptionalDependentPackages.

Return
MutableList<VersionedPackage!> The dependent packages.
This value cannot be null.

getLongVersion

Added in API level 28
fun getLongVersion(): Long

Gets the version of the library. For static libraries this is the declared version and for dynamic and builtin it is VERSION_UNDEFINED as these are not versioned.

Return
Long The version.
Value is -1 or greater

getName

Added in API level 26
fun getName(): String!

Gets the library name an app defines in its manifest to depend on the library.

Return
String! The name.

getType

Added in API level 26
fun getType(): Int

Gets the type of this library.

Return
Int The library type.
Value is either 0 or a combination of the following:

getVersion

Added in API level 26
Deprecated in API level 28
fun getVersion(): Int

Deprecated: Use getLongVersion() instead.

Return
Int Value is -1 or greater

toString

Added in API level 26
fun toString(): String

Returns a string representation of the object.

Return
String a string representation of the object.

writeToParcel

Added in API level 26
fun writeToParcel(
    parcel: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
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 the following:

Properties

CREATOR

Added in API level 26
static val CREATOR: Parcelable.Creator<SharedLibraryInfo!>