bond
bond

Reputation: 11346

CameraDevice 2 API Holding resource after close

I get the camera resource in Android activity onResume and onPause call

CameraDevice .close();

I am running into issue where user quickly opens another camera app before CamreaDevice is released is causing other camera app to error out saying "warning camera failed". Reading the documentation CameraDevice

Close the connection to this camera device as quickly as possible.

Immediately after this call, all calls to the camera device or active session interface will throw a IllegalStateException, except for calls to close(). Once the device has fully shut down, the onClosed(CameraDevice) callback will be called, and the camera is free to be re-opened.

Immediately after this call, besides the final onClosed(CameraDevice) calls, no further callbacks from the device or the active session will occur, and any remaining submitted capture requests will be discarded, as if abortCaptures() had been called, except that no success or failure callbacks will be invoked.

Is there a way to ensure camera is released right-a-way for others to grab?

Upvotes: 4

Views: 292

Answers (0)

Related Questions