The second Android 11 Developer Preview is now available, test it out and share your feedback.

SidecarProvider

open class SidecarProvider
kotlin.Any
   ↳ androidx.window.sidecar.SidecarProvider

A stub implementation for the class that will instantiate the Sidecar.

This class should be implemented by OEM and deployed to the target devices.

Summary

Public methods

open static String?

Get the version of the vendor library on this device.

open static SidecarInterface?
getSidecarImpl(@NonNull context: Context)

Instantiate the Sidecar for the use by the WindowManager library.

Public methods

getApiVersion

@Nullable open static fun getApiVersion(): String?

Get the version of the vendor library on this device. If the returned version is not supported by the WindowManager library, then some functions may not be available or replaced with stub implementations.

WindowManager library provides the Semantic Versioning string in a form of MAJOR.MINOR.PATCH-description We will increment the MAJOR version when make incompatible API changes, MINOR version when add functionality in a backwards-compatible manner, and PATCH version when make backwards-compatible bug fixes. And the description can be ignored.

Vendor sidecar library should provide MAJOR.MINOR.PATCH to the WindowManager library. The MAJOR and MINOR version are used to identify the interface version that the library will use. The PATCH version does not indicate compatibility. The patch version should be incremented whenever the vendor library makes bug fixes or updates to the algorithm.

Return
String? the version that vendor supported in this device. The MAJOR.MINOR.PATCH format should be used.

getSidecarImpl

@Nullable open static fun getSidecarImpl(@NonNull context: Context): SidecarInterface?

Instantiate the Sidecar for the use by the WindowManager library.

The library will instantiate the vendor implementation using this interface.

Return
SidecarInterface? A compatible version of the SidecarInterface for the provided library version string, or null if not available.