Google is committed to advancing racial equity for Black communities. See how.

ExtensionProvider

public class ExtensionProvider
extends Object

java.lang.Object
   ↳ androidx.window.extensions.ExtensionProvider


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

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

See also:

Summary

Public methods

static String getApiVersion()

Get the version of the vendor library on this device.

static ExtensionInterface getExtensionImpl(Context context)

Instantiate the Extension for the use by the WindowManager library.

Inherited methods

Public methods

getApiVersion

public static String getApiVersion ()

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

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

getExtensionImpl

public static ExtensionInterface getExtensionImpl (Context context)

Instantiate the Extension for the use by the WindowManager library.

The library will instantiate the vendor implementation using this interface.

Parameters
context Context

Returns
ExtensionInterface A compatible version of the ExtensionInterface for the provided library version string, or null if not available.