Added in API level 30

CameraOfflineSession


abstract class CameraOfflineSession : CameraCaptureSession
kotlin.Any
   ↳ android.hardware.camera2.CameraCaptureSession
   ↳ android.hardware.camera2.CameraOfflineSession

A camera capture session that was switched to offline mode via successful call to CameraCaptureSession#switchToOffline.

Offline capture sessions allow clients to select a set of camera registered surfaces that support offline mode. After a successful offline mode switch all non-repeating pending requests on those surfaces will continue to be processed by the camera stack even if clients close the corresponding camera device.

Offline capture session instances will replace the previously active capture session arguments in all capture callbacks after CameraCaptureSession#switchToOffline completes.

Processing of pending offline capture requests will begin only after the offline session moves to ready state which will be indicated by the CameraOfflineSessionCallback#onReady callback.

In contrast to a regular CameraCaptureSession an offline capture session will not accept any further capture requests. Besides android.hardware.camera2.CameraOfflineSession#close all remaining methods will throw UnsupportedOperationException and are not supported.

Summary

Nested classes
abstract

Public constructors

Public methods
abstract Unit

Close this offline capture session.

Inherited functions

Public constructors

CameraOfflineSession

CameraOfflineSession()

Public methods

close

Added in API level 30
abstract fun close(): Unit

Close this offline capture session.

Abort all pending offline requests and close the connection to the offline camera session as quickly as possible.

This method can be called only after clients receive CameraOfflineSessionCallback#onReady.

Immediately after this call, besides the final CameraOfflineSessionCallback#onClosed notification, no further callbacks from the offline session will be triggered and all remaining offline capture requests will be discarded.

Closing a session is idempotent; closing more than once has no effect.

Exceptions
java.lang.Exception if this resource cannot be closed
java.lang.IllegalStateException if the offline session is not ready.