SharedLibraryInfo
  public
  
  final
  
  class
  SharedLibraryInfo
  
    extends Object
  
  
  
  
  
      implements
      
        Parcelable
      
  
  
| java.lang.Object | |
| ↳ | 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 | |
|---|---|
| int | TYPE_BUILTINShared library type: this library is a part of the OS and cannot be updated or uninstalled. | 
| int | TYPE_DYNAMICShared library type: this library is backwards-compatible, can be updated, and updates can be uninstalled. | 
| int | TYPE_SDK_PACKAGESDK package shared library type: this library is not compatible between versions, can be updated and updates can be uninstalled. | 
| int | TYPE_STATICShared library type: this library is not backwards -compatible, can be updated and updates can be uninstalled. | 
| int | VERSION_UNDEFINEDConstant for referring to an undefined version. | 
| Inherited constants | 
|---|
| Fields | |
|---|---|
| 
    public
    static
    final
    Creator<SharedLibraryInfo> | CREATOR
 | 
| Public methods | |
|---|---|
| 
        
        
        
        
        
        int | 
      describeContents()
      Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. | 
| 
        
        
        
        
        
        List<String> | 
      getCertDigests()
      Gets the list of certificate digests for the shared library. | 
| 
        
        
        
        
        
        VersionedPackage | 
      getDeclaringPackage()
      Gets the package that declares the library. | 
| 
        
        
        
        
        
        List<VersionedPackage> | 
      getDependentPackages()
      Gets the packages that depend on the library. | 
| 
        
        
        
        
        
        long | 
      getLongVersion()
      Gets the version of the library. | 
| 
        
        
        
        
        
        String | 
      getName()
      Gets the library name an app defines in its manifest to depend on the library. | 
| 
        
        
        
        
        
        int | 
      getType()
      Gets the type of this library. | 
| 
        
        
        
        
        
        int | 
      getVersion()
      
      This method was deprecated
      in API level 28.
    Use  | 
| 
        
        
        
        
        
        String | 
      toString()
      Returns a string representation of the object. | 
| 
        
        
        
        
        
        void | 
      writeToParcel(Parcel parcel, int flags)
      Flatten this object in to a Parcel. | 
| Inherited methods | |
|---|---|
Constants
TYPE_BUILTIN
public static final int TYPE_BUILTIN
Shared library type: this library is a part of the OS and cannot be updated or uninstalled.
Constant Value: 0 (0x00000000)
TYPE_DYNAMIC
public static final int TYPE_DYNAMIC
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.
Constant Value: 1 (0x00000001)
TYPE_SDK_PACKAGE
public static final int TYPE_SDK_PACKAGE
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.
Constant Value: 3 (0x00000003)
TYPE_STATIC
public static final int TYPE_STATIC
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.
Constant Value: 2 (0x00000002)
VERSION_UNDEFINED
public static final int VERSION_UNDEFINED
Constant for referring to an undefined version.
Constant Value: -1 (0xffffffff)
Fields
Public methods
describeContents
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 writeToParcel(android.os.Parcel, int),
 the return value of this method must include the
 CONTENTS_FILE_DESCRIPTOR bit.
| Returns | |
|---|---|
| int | a bitmask indicating the set of special object types marshaled
 by this Parcelable object instance.
 Value is either 0orCONTENTS_FILE_DESCRIPTOR | 
getCertDigests
public List<String> getCertDigests ()
Gets the list of certificate digests for the shared library.
| Returns | |
|---|---|
| List<String> | The list of certificate digests
 This value cannot be null. | 
getDeclaringPackage
public VersionedPackage getDeclaringPackage ()
Gets the package that declares the library.
| Returns | |
|---|---|
| VersionedPackage | The package declaring the library.
 This value cannot be null. | 
getDependentPackages
public List<VersionedPackage> getDependentPackages ()
Gets the packages that depend on the library.
 NOTE: the list also contains the result of ERROR(/#getOptionalDependentPackages).
| Returns | |
|---|---|
| List<VersionedPackage> | The dependent packages.
 This value cannot be null. | 
getLongVersion
public long getLongVersion ()
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.
| Returns | |
|---|---|
| long | The version. Value is -1 or greater | 
getName
public String getName ()
Gets the library name an app defines in its manifest to depend on the library.
| Returns | |
|---|---|
| String | The name. | 
getType
public int getType ()
Gets the type of this library.
| Returns | |
|---|---|
| int | The library type.
 Value is either 0or a combination ofTYPE_BUILTIN,TYPE_DYNAMIC,TYPE_STATIC, andTYPE_SDK_PACKAGE | 
getVersion
public int getVersion ()
      This method was deprecated
      in API level 28.
    Use getLongVersion() instead.
  
| Returns | |
|---|---|
| int | Value is -1 or greater | 
toString
public String toString ()
Returns a string representation of the object.
| Returns | |
|---|---|
| String | a string representation of the object. | 
writeToParcel
public void writeToParcel (Parcel parcel, int flags)
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
| parcel | Parcel: The Parcel in which the object should be written.
 This value cannot benull. | 
| flags | int: Additional flags about how the object should be written.
 May be 0 orParcelable.PARCELABLE_WRITE_RETURN_VALUE.
 Value is either0or a combination ofParcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES | 
