Camera: Correct request buffer error status
Camera providers can occasionally reach the maximum amount of de-queue
buffers which will fail any further acquire requests.
Return the corresponding native error status so that providers can
handle this corner case accordingly.
Bug: 232562516
Test: Camera CTS
Change-Id: I6986a15cddb951a284f25dd4aabcbbe14224e33f
diff --git a/services/camera/libcameraservice/device3/aidl/AidlCamera3OutputUtils.cpp b/services/camera/libcameraservice/device3/aidl/AidlCamera3OutputUtils.cpp
index 3809f37..02eebd2 100644
--- a/services/camera/libcameraservice/device3/aidl/AidlCamera3OutputUtils.cpp
+++ b/services/camera/libcameraservice/device3/aidl/AidlCamera3OutputUtils.cpp
@@ -244,6 +244,8 @@
__FUNCTION__, streamId, strerror(-res), res);
if (res == TIMED_OUT || res == NO_MEMORY) {
bufRet.val.set<Tag::error>(StreamBufferRequestError::NO_BUFFER_AVAILABLE);
+ } else if (res == INVALID_OPERATION) {
+ bufRet.val.set<Tag::error>(StreamBufferRequestError::MAX_BUFFER_EXCEEDED);
} else {
bufRet.val.set<Tag::error>(StreamBufferRequestError::UNKNOWN_ERROR);
}