From 7ec2b704faa7bac3d82338cb708f4dc0612c9917 Mon Sep 17 00:00:00 2001 From: Amy Zhang Date: Mon, 5 Oct 2020 18:07:20 -0700 Subject: [PATCH] Add isHighPriority scan message type into Tuner HAL 1.1 Test: atest VtsHalTvTunerV1_1TargetTest Bug: 169868608 Change-Id: I49a82dc9eda0fc9b1f90bc67cd6d1a20bbafcc00 --- tv/tuner/1.1/default/Frontend.cpp | 5 ++++- tv/tuner/1.1/types.hal | 7 ++++++- tv/tuner/1.1/vts/functional/FrontendTests.cpp | 9 ++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/tv/tuner/1.1/default/Frontend.cpp b/tv/tuner/1.1/default/Frontend.cpp index 971e335700..7c6f8c6f97 100644 --- a/tv/tuner/1.1/default/Frontend.cpp +++ b/tv/tuner/1.1/default/Frontend.cpp @@ -122,9 +122,12 @@ Return Frontend::scan(const FrontendSettings& settings, FrontendScanType V1_1::IFrontendCallback::castFrom(mCallback); if (frontendCallback_v1_1 != NULL) { V1_1::FrontendScanMessageExt1_1 msg; - msg.dvbc(FrontendDvbcModulation::MOD_16QAM); + msg.modulation().dvbc(FrontendDvbcModulation::MOD_16QAM); frontendCallback_v1_1->onScanMessageExt1_1(V1_1::FrontendScanMessageTypeExt1_1::MODULATION, msg); + msg.isHighPriority(true); + frontendCallback_v1_1->onScanMessageExt1_1( + V1_1::FrontendScanMessageTypeExt1_1::HIGH_PRIORITY, msg); } else { ALOGD("[Filter] Couldn't cast to V1_1 IFrontendCallback"); } diff --git a/tv/tuner/1.1/types.hal b/tv/tuner/1.1/types.hal index b20e6252f0..f8fe2aaf9e 100644 --- a/tv/tuner/1.1/types.hal +++ b/tv/tuner/1.1/types.hal @@ -555,6 +555,11 @@ safe_union FrontendStatusExt1_1 { enum FrontendScanMessageTypeExt1_1 : uint32_t { MODULATION = @1.0::FrontendScanMessageType:ATSC3_PLP_INFO + 1, + HIGH_PRIORITY, }; -typedef FrontendModulation FrontendScanMessageExt1_1; +safe_union FrontendScanMessageExt1_1 { + FrontendModulation modulation; + + bool isHighPriority; +}; diff --git a/tv/tuner/1.1/vts/functional/FrontendTests.cpp b/tv/tuner/1.1/vts/functional/FrontendTests.cpp index 3bc7114b17..e5793c1f34 100644 --- a/tv/tuner/1.1/vts/functional/FrontendTests.cpp +++ b/tv/tuner/1.1/vts/functional/FrontendTests.cpp @@ -51,9 +51,12 @@ Return FrontendCallback::onScanMessageExt1_1(FrontendScanMessageTypeExt1_1 const FrontendScanMessageExt1_1& message) { android::Mutex::Autolock autoLock(mMsgLock); ALOGD("[vts] frontend ext1_1 scan message. Type: %d", type); - switch (type) { - case FrontendScanMessageTypeExt1_1::MODULATION: - readFrontendScanMessageExt1_1Modulation(message); + switch (message.getDiscriminator()) { + case FrontendScanMessageExt1_1::hidl_discriminator::modulation: + readFrontendScanMessageExt1_1Modulation(message.modulation()); + break; + case FrontendScanMessageExt1_1::hidl_discriminator::isHighPriority: + ALOGD("[vts] frontend ext1_1 scan message high priority: %d", message.isHighPriority()); break; default: break;