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

ExtensionInterface

interface ExtensionInterface
androidx.window.extensions.ExtensionInterface

Main Extension interface definition that will be used by the WindowManager library to get custom OEM-provided information that isn't covered by platform APIs.

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

Summary

Nested classes

abstract

Callback that will be registered with the WindowManager library, and that the extension should use to report all state changes.

Public methods

abstract ExtensionDeviceState

Get current device state.

abstract ExtensionWindowLayoutInfo
getWindowLayoutInfo(@NonNull windowToken: IBinder)

Get current information about the display features present within the application window.

abstract Unit

Notify the extension that a device state change listener was updated.

abstract Unit

Notify extension that a listener for display feature layout changes was registered for the given window token.

abstract Unit

Notify extension that a listener for display feature layout changes was removed for the given window token.

abstract Unit

Register the support library as the callback for the extension.

Public methods

getDeviceState

@NonNull abstract fun getDeviceState(): ExtensionDeviceState

Get current device state.

getWindowLayoutInfo

@NonNull abstract fun getWindowLayoutInfo(@NonNull windowToken: IBinder): ExtensionWindowLayoutInfo

Get current information about the display features present within the application window.

onDeviceStateListenersChanged

abstract fun onDeviceStateListenersChanged(isEmpty: Boolean): Unit

Notify the extension that a device state change listener was updated.

Parameters
isEmpty Boolean: flag indicating if the list of device state change listeners is empty.

onWindowLayoutChangeListenerAdded

abstract fun onWindowLayoutChangeListenerAdded(@NonNull windowToken: IBinder): Unit

Notify extension that a listener for display feature layout changes was registered for the given window token.

onWindowLayoutChangeListenerRemoved

abstract fun onWindowLayoutChangeListenerRemoved(@NonNull windowToken: IBinder): Unit

Notify extension that a listener for display feature layout changes was removed for the given window token.

setExtensionCallback

abstract fun setExtensionCallback(@NonNull callback: ExtensionInterface.ExtensionCallback): Unit

Register the support library as the callback for the extension. This interface will be used to report all extension changes to the support library.