From 3002f283ea363a4a173e1ba1330a0c9dc5935987 Mon Sep 17 00:00:00 2001 From: Maxime Fournier Date: Mon, 25 Aug 2025 11:08:11 +0200 Subject: [PATCH] android: hal: implement repeatingRequestEnd callback Add proper implementation of repeatingRequestEnd() function for Android Camera HAL compliance. Validates stream IDs and logs notification about the final frame number when repeating requests end. This is a lightweight notification callback that informs the HAL when repeating capture requests will terminate at a specific frame number for given streams, as required by the Android Camera HAL specification. Always return Status::OK since the method must always succeed as described in [1]. [1] https://android.googlesource.com/platform/hardware/interfaces/+/master/camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl#570 Signed-off-by: Maxime Fournier --- .../hal/device/LibcameraDeviceSession.cpp | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/android/hal/device/LibcameraDeviceSession.cpp b/src/android/hal/device/LibcameraDeviceSession.cpp index e8473391..6a0506ac 100644 --- a/src/android/hal/device/LibcameraDeviceSession.cpp +++ b/src/android/hal/device/LibcameraDeviceSession.cpp @@ -1657,8 +1657,32 @@ ScopedAStatus LibcameraDeviceSession::switchToOffline( } ScopedAStatus LibcameraDeviceSession::repeatingRequestEnd( int32_t in_frameNumber, const std::vector& in_streamIds) { - ALOGI("%s()", __func__); - return fromStatus(Status::INTERNAL_ERROR); + ALOGV("%s: frameNumber %d, streamIds size %zu", __FUNCTION__, in_frameNumber, in_streamIds.size()); + + Status status = initStatus(); + if (status != Status::OK) { + ALOGE("%s: camera init failed or disconnected", __FUNCTION__); + return fromStatus(Status::OK); + } + + // Validate stream IDs + for (int32_t streamId : in_streamIds) { + if (mStreamMap.find(streamId) == mStreamMap.end()) { + ALOGE("%s: Invalid stream ID %d", __FUNCTION__, streamId); + return fromStatus(Status::OK); + } + } + + // Log the notification for debugging purposes + ALOGD("%s: Repeating request ending at frame %d for %zu streams", + __FUNCTION__, in_frameNumber, in_streamIds.size()); + + // This is a notification callback - no action required by HAL + // The framework is informing us that the repeating request will end + // at the specified frame number for the given streams. + // Since this is lightweight notification, we simply acknowledge it. + + return fromStatus(Status::OK); } } // namespace implementation