Added in API level 30

CameraOfflineSessionCallback


abstract class CameraOfflineSessionCallback
kotlin.Any
   ↳ android.hardware.camera2.CameraOfflineSession.CameraOfflineSessionCallback

Summary

Constants
static Int

This status code indicates unexpected and fatal internal camera error.

Public constructors

Public methods
abstract Unit

This method is called when the offline session is closed.

abstract Unit
onError(session: CameraOfflineSession, status: Int)

This method is called when the offline session encounters an unexpected error.

abstract Unit

This method indicates that all pending offline requests were processed.

abstract Unit

This method indicates that the offline switch call CameraCaptureSession#switchToOffline was successful.

abstract Unit

This method indicates that the offline switch call CameraCaptureSession#switchToOffline was not able to complete successfully.

Constants

STATUS_INTERNAL_ERROR

Added in API level 30
static val STATUS_INTERNAL_ERROR: Int

This status code indicates unexpected and fatal internal camera error.

Pending offline requests will be discarded and the respective registered capture callbacks may not get triggered.

Value: 0

See Also

Public constructors

CameraOfflineSessionCallback

CameraOfflineSessionCallback()

Public methods

onClosed

Added in API level 30
abstract fun onClosed(session: CameraOfflineSession): Unit

This method is called when the offline session is closed.

An offline session will be closed after a call to android.hardware.camera2.CameraOfflineSession#close.

In case of failure to switch to offline mode, only onSwitchFailed will be called and onClosed will not be.

In case there was no previous onIdle notification any in-progress offline capture requests within the offline session will be discarded and further result callbacks will not be triggered.

Parameters
session CameraOfflineSession: the session returned by CameraCaptureSession#switchToOffline This value cannot be null.

onError

Added in API level 30
abstract fun onError(
    session: CameraOfflineSession,
    status: Int
): Unit

This method is called when the offline session encounters an unexpected error.

This notification will only be invoked for sessions that reached the ready state. Clients will need to call android.hardware.camera2.CameraOfflineSession#close to close and release all resources. onClosed will not be triggered automatically in error scenarios.

Parameters
session CameraOfflineSession: the current offline session This value cannot be null.
status Int: error status Value is android.hardware.camera2.CameraOfflineSession.CameraOfflineSessionCallback#STATUS_INTERNAL_ERROR

onIdle

Added in API level 30
abstract fun onIdle(session: CameraOfflineSession): Unit

This method indicates that all pending offline requests were processed.

This callback will be invoked once the offline session finishes processing all of its pending offline capture requests.

Parameters
session CameraOfflineSession: the currently ready offline session This value cannot be null.

onReady

Added in API level 30
abstract fun onReady(session: CameraOfflineSession): Unit

This method indicates that the offline switch call CameraCaptureSession#switchToOffline was successful.

This callback will be invoked once the offline session moves to the ready state.

Calls to CameraDevice#close will not have impact on the processing of offline requests once the offline session moves in ready state.

Parameters
session CameraOfflineSession: the currently ready offline session This value cannot be null.

onSwitchFailed

Added in API level 30
abstract fun onSwitchFailed(session: CameraOfflineSession): Unit

This method indicates that the offline switch call CameraCaptureSession#switchToOffline was not able to complete successfully.

The offline switch can fail either due to internal camera error during the switch sequence or because the camera implementation was not able to find any pending capture requests that can be migrated to offline mode.

Calling android.hardware.camera2.CameraOfflineSession#close is not necessary and clients will not receive any further offline session notifications.

Parameters
session CameraOfflineSession: the offline session that failed to switch to ready state This value cannot be null.