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

ExtensionsManager

class ExtensionsManager
kotlin.Any
   ↳ androidx.camera.extensions.ExtensionsManager

Provides interfaces for third party app developers to get capabilities info of extension functions.

Summary

Nested classes

The effect mode options applied on the bound use cases

Public methods
static ListenableFuture<ExtensionsManager.ExtensionsAvailability!>
init(@NonNull context: Context)

Initialize the extensions asynchronously.

static Boolean
isExtensionAvailable(@NonNull effectMode: ExtensionsManager.EffectMode, lensFacing: Int)

Indicates whether the camera device with the lensFacing can support the specific extension function.

static Boolean
isExtensionAvailable(@NonNull klass: Class<*>, @NonNull effectMode: ExtensionsManager.EffectMode, lensFacing: Int)

Indicates whether the camera device with the lensFacing can support the specific extension function for specific use case.

static Unit

Sets an ExtensionsErrorListener which will get called any time an extensions error is encountered.

Public methods

init

@NonNull static fun init(@NonNull context: Context): ListenableFuture<ExtensionsManager.ExtensionsAvailability!>

Initialize the extensions asynchronously.

This should be the first call to the extensions module. An application must wait until the ListenableFuture completes before making any other calls to the extensions module.

isExtensionAvailable

static fun isExtensionAvailable(
    @NonNull effectMode: ExtensionsManager.EffectMode,
    lensFacing: Int
): Boolean

Indicates whether the camera device with the lensFacing can support the specific extension function.

Parameters
effectMode ExtensionsManager.EffectMode: The extension function to be checked.
lensFacing Int: The lensFacing of the camera device to be checked.
Return
Boolean True if the specific extension function is supported for the camera device.

isExtensionAvailable

static fun isExtensionAvailable(
    @NonNull klass: Class<*>,
    @NonNull effectMode: ExtensionsManager.EffectMode,
    lensFacing: Int
): Boolean

Indicates whether the camera device with the lensFacing can support the specific extension function for specific use case.

Parameters
klass Class<*>: The ImageCapture or Preview class to be checked.
effectMode ExtensionsManager.EffectMode: The extension function to be checked.
lensFacing Int: The lensFacing of the camera device to be checked.
Return
Boolean True if the specific extension function is supported for the camera device.

setExtensionsErrorListener

static fun setExtensionsErrorListener(@Nullable listener: ExtensionsErrorListener?): Unit

Sets an ExtensionsErrorListener which will get called any time an extensions error is encountered.

Parameters
listener ExtensionsErrorListener?: The ExtensionsErrorListener listener that will be run.