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
This commit is contained in:
Amy Zhang 2021-03-05 16:19:26 -08:00
parent f46a812e58
commit d7ce9e5b17

View file

@ -259,11 +259,14 @@ Return<void> Filter::getAvSharedHandle(getAvSharedHandle_cb _hidl_cb) {
int av_fd = createAvIonFd(BUFFER_SIZE_16M); int av_fd = createAvIonFd(BUFFER_SIZE_16M);
if (av_fd == -1) { if (av_fd == -1) {
_hidl_cb(Result::UNKNOWN_ERROR, NULL, 0); _hidl_cb(Result::UNKNOWN_ERROR, NULL, 0);
return Void();
} }
native_handle_t* nativeHandle = createNativeHandle(av_fd); native_handle_t* nativeHandle = createNativeHandle(av_fd);
if (nativeHandle == NULL) { if (nativeHandle == NULL) {
::close(av_fd);
_hidl_cb(Result::UNKNOWN_ERROR, NULL, 0); _hidl_cb(Result::UNKNOWN_ERROR, NULL, 0);
return Void();
} }
mSharedAvMemHandle.setTo(nativeHandle, /*shouldOwn=*/true); mSharedAvMemHandle.setTo(nativeHandle, /*shouldOwn=*/true);
::close(av_fd); ::close(av_fd);