EnhancementClient

@DoNotMock(value = "Use canonical fakes instead.")
interface EnhancementClient : HasApiKey, OptionalModuleApi


The Enhancement client provides a way to create a EnhancementSession. The client is also used to provide availability checks and module installation.

Summary

Nested types

A callback for the module installation status.

Public functions

Task<EnhancementSession?>
createSession(
    options: EnhancementOptions,
    callback: EnhancementSessionCallback
)

Creates a EnhancementSession.

Task<Boolean>
installModule(
    installStatusCallback: EnhancementClient.InstallStatusCallback?
)

Installs the Enhancement module.

Task<Boolean>

Checks if the module is supported on this device.

Task<Boolean>

Checks if the module is already installed.

Task<Void?>

Marks the Enhancement module as no longer needed for this application.

Public functions

createSession

fun createSession(
    options: EnhancementOptions,
    callback: EnhancementSessionCallback
): Task<EnhancementSession?>

Creates a EnhancementSession.

An enhancement session manages the necessary Surface to receive input frames from the app and send the enhanced frames to a Surface provided by the app.

Parameters
options: EnhancementOptions

The options for the session.

callback: EnhancementSessionCallback

An implementation of EnhancementSessionCallback.

Returns
Task<EnhancementSession?>

A task that resolves to the created EnhancementSession or null if the session could not be created.

installModule

fun installModule(
    installStatusCallback: EnhancementClient.InstallStatusCallback? = null
): Task<Boolean>

Installs the Enhancement module.

Parameters
installStatusCallback: EnhancementClient.InstallStatusCallback? = null

A callback to receive status updates.

Returns
Task<Boolean>

A task that resolves to true if the module is installed successfully.

isDeviceSupported

fun isDeviceSupported(): Task<Boolean>

Checks if the module is supported on this device.

Only devices which support image or video enhancement will be able to create a EnhancementSession.

Returns
Task<Boolean>

A task that resolves to true if the device is supported, false otherwise.

isModuleInstalled

fun isModuleInstalled(): Task<Boolean>

Checks if the module is already installed.

Returns
Task<Boolean>

A task that resolves to true if the module is installed, false otherwise.

releaseModule

fun releaseModule(): Task<Void?>

Marks the Enhancement module as no longer needed for this application. The module will be released at some point in the future.

Returns
Task<Void?>

A task that resolves when the module is released.