Add missing return in Tuner default impl getAvSharedHandle after hidl_cb
Per CTS automation test failure logs:
Abort message: 'getAvSharedHandle: _hidl_cb called a second time, but must be called once.'
this should be the root cause of the failure.
Couldn't reproduce locally.
Test: make
Bug: 181997400
Change-Id: Ib3fb5ad535ab51cc7281c3f81a61d1913a1f4e65
diff --git a/tv/tuner/1.1/default/Filter.cpp b/tv/tuner/1.1/default/Filter.cpp
index aec1fd0..5ddac99 100644
--- a/tv/tuner/1.1/default/Filter.cpp
+++ b/tv/tuner/1.1/default/Filter.cpp
@@ -259,11 +259,14 @@
int av_fd = createAvIonFd(BUFFER_SIZE_16M);
if (av_fd == -1) {
_hidl_cb(Result::UNKNOWN_ERROR, NULL, 0);
+ return Void();
}
native_handle_t* nativeHandle = createNativeHandle(av_fd);
if (nativeHandle == NULL) {
+ ::close(av_fd);
_hidl_cb(Result::UNKNOWN_ERROR, NULL, 0);
+ return Void();
}
mSharedAvMemHandle.setTo(nativeHandle, /*shouldOwn=*/true);
::close(av_fd);