camera-samples icon indicating copy to clipboard operation
camera-samples copied to clipboard

The handler for setRepeatingRequest() can be null when callback is null.

Open ecoopnet opened this issue 5 years ago • 0 comments

The argument Handler of CameraCaptureSession.setRepeatingRequest() can be null when callback is null because it is never used.

For [example](https://github.com/android/camera-samples/blob/2b446855ca2662db42ff1755968f6af495c2a962/Camera2Video/app/src/main/java/com/example/android/camera2/video/fragments/CameraFragment.kt#L253]

session.setRepeatingRequest(previewRequest, null, cameraHandler)

In document of CameraCaptureSession.setRepeatingRequest() says that the parameter handler is the handler on which the listener should be invoked. So If the listener is null, the handler can be null.

I also looked at the setRepeatingRequest source code to be sure, but the handler is not used when the callback is null.

http://gerrit.aospextended.com/plugins/gitiles/AospExtended/platform_frameworks_base/+/25df673b849de374cf1de40250dfd8a48b7ac28b/core/java/android/hardware/camera2/impl/CameraDevice.java#269

ecoopnet avatar Aug 27 '20 07:08 ecoopnet