android / android/camera-samples
The handler for setRepeatingRequest() can be null when callback is null.
- Dominant language
- Kotlin
- Stars
- 5.5k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
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]
```kotlin
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
Contributor guide
Assessment
This issue has not been assessed yet.