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

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.

MutableList<VersionedPackage!>

Gets the packages that optionally depend on the library.

Int

Gets the type of this library.

Int

String

Unit
writeToParcel(parcel: Parcel, flags: Int)

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
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

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.

getOptionalDependentPackages

fun getOptionalDependentPackages(): MutableList<VersionedPackage!>

Gets the packages that optionally depend on the library.

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

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
Return
String a string representation of the object.

writeToParcel

Added in API level 26
fun writeToParcel(
    parcel: Parcel,
    flags: Int
): Unit
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 android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

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