From cbb2468533348a31ef18411d7353781277cce43d Mon Sep 17 00:00:00 2001 From: Yixiao Luo Date: Thu, 14 Dec 2023 11:43:22 -0800 Subject: [PATCH] Make sideband stream handle validation configurable Bug: 311341683 Test: VtsHalTvInputTargetTest Change-Id: I3f4319793039cc1dce39ce4e6a31f4c5abdbb7e0 --- .../aidl/vts/functional/VtsHalTvInputTargetTest.cpp | 10 ++++++++-- tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp index 746ae1e1af..7e095f1499 100644 --- a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp +++ b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp @@ -14,6 +14,8 @@ * limitations under the License. */ +#define LOG_TAG "tv_input_aidl_hal_test" + #include "VtsHalTvInputTargetTest.h" #include @@ -181,7 +183,9 @@ TEST_P(TvInputAidlTest, OpenAndCloseStreamTest) { ALOGD("OpenAndCloseStreamTest: open stream, device_id=%d, stream_id=%d", device_id, stream_id); ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle).isOk()); - ASSERT_TRUE(isValidHandle(handle)); + if (VERIFY_SIDEBAND_STREAM_HANDLE) { + ASSERT_TRUE(isValidHandle(handle)); + } ALOGD("OpenAndCloseStreamTest: close stream, device_id=%d, stream_id=%d", device_id, stream_id); @@ -283,7 +287,9 @@ TEST_P(TvInputAidlTest, OpenAnOpenedStreamsTest) { ALOGD("OpenAnOpenedStreamsTest: open stream, device_id=%d, stream_id=%d", device_id, stream_id); ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle).isOk()); - ASSERT_TRUE(isValidHandle(handle)); + if (VERIFY_SIDEBAND_STREAM_HANDLE) { + ASSERT_TRUE(isValidHandle(handle)); + } ALOGD("OpenAnOpenedStreamsTest: open stream, device_id=%d, stream_id=%d", device_id, stream_id); ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle).getServiceSpecificError() == diff --git a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h index 7e66a88a32..fd98a18c47 100644 --- a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h +++ b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h @@ -43,6 +43,7 @@ using ::android::AidlMessageQueue; #define WAIT_FOR_EVENT_TIMEOUT 5 #define DEFAULT_ID INT32_MIN +#define VERIFY_SIDEBAND_STREAM_HANDLE 1 namespace VtsHalTvInputTargetTest {