CameraOfflineSession.CameraOfflineSessionCallback


public static abstract class CameraOfflineSession.CameraOfflineSessionCallback
extends Object

java.lang.Object
   ↳ android.hardware.camera2.CameraOfflineSession.CameraOfflineSessionCallback


Summary

Constants

int STATUS_INTERNAL_ERROR

This status code indicates unexpected and fatal internal camera error.

Public constructors

CameraOfflineSessionCallback()

Public methods

abstract void onClosed(CameraOfflineSession session)

This method is called when the offline session is closed.

abstract void onError(CameraOfflineSession session, int status)

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

abstract void onIdle(CameraOfflineSession session)

This method indicates that all pending offline requests were processed.

abstract void onReady(CameraOfflineSession session)

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

abstract void onSwitchFailed(CameraOfflineSession session)

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

Inherited methods

Constants

STATUS_INTERNAL_ERROR

Added in API level 30
public static final int STATUS_INTERNAL_ERROR

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.

Constant Value: 0 (0x00000000)

Public constructors

CameraOfflineSessionCallback

public CameraOfflineSessionCallback ()

Public methods

onClosed

Added in API level 30
public abstract void onClosed (CameraOfflineSession session)

This method is called when the offline session is closed.

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

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

In case there was no previous onIdle(CameraOfflineSession) 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
public abstract void onError (CameraOfflineSession session, 
                int status)

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 CameraOfflineSession#close to close and release all resources. onClosed(CameraOfflineSession) 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 STATUS_INTERNAL_ERROR

onIdle

Added in API level 30
public abstract void onIdle (CameraOfflineSession session)

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
public abstract void onReady (CameraOfflineSession session)

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
public abstract void onSwitchFailed (CameraOfflineSession session)

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