[RESTRICT AUTOMERGE] Check HIDL return status
This change adds lines to check a HIDL return status and output
debugging messages if a binder call fails.
Bug: 174580577
Test: vts-tradefed run commandAndExit vts-hal-auto
--skip-all-system-status-check
--primary-abi-only
--skip-preconditions
-m VtsHalEvsV1_1Target --test EvsHidlTest#CameraOpenClean
Change-Id: I748da13699727109ce23ea2639dc248dd186cfd7
diff --git a/evs/apps/default/StreamHandler.cpp b/evs/apps/default/StreamHandler.cpp
index d350af1..a442b77 100644
--- a/evs/apps/default/StreamHandler.cpp
+++ b/evs/apps/default/StreamHandler.cpp
@@ -193,7 +193,10 @@
hidl_vec<BufferDesc_1_1> frames;
frames.resize(1);
frames[0] = mBuffers[mHeldBuffer];
- mCamera->doneWithFrame_1_1(frames);
+ auto ret = mCamera->doneWithFrame_1_1(frames);
+ if (!ret.isOk()) {
+ LOG(WARNING) << __FUNCTION__ << " fails to return a buffer";
+ }
// Clear the held position
mHeldBuffer = -1;
@@ -202,7 +205,10 @@
Return<void> StreamHandler::deliverFrame(const BufferDesc_1_0& bufDesc_1_0) {
LOG(INFO) << "Ignores a frame delivered from v1.0 EVS service.";
- mCamera->doneWithFrame(bufDesc_1_0);
+ auto ret = mCamera->doneWithFrame(bufDesc_1_0);
+ if (!ret.isOk()) {
+ LOG(WARNING) << __FUNCTION__ << " fails to return a buffer";
+ }
return Void();
}
@@ -225,7 +231,10 @@
hidl_vec<BufferDesc_1_1> frames;
frames.resize(1);
frames[0] = mBuffers[mReadyBuffer];
- mCamera->doneWithFrame_1_1(frames);
+ auto ret = mCamera->doneWithFrame_1_1(frames);
+ if (!ret.isOk()) {
+ LOG(WARNING) << __FUNCTION__ << " fails to return a buffer";
+ }
// We'll reuse the same ready buffer index
} else if (mHeldBuffer >= 0) {