Add isHighPriority scan message type into Tuner HAL 1.1
Test: atest VtsHalTvTunerV1_1TargetTest
Bug: 169868608
Change-Id: I49a82dc9eda0fc9b1f90bc67cd6d1a20bbafcc00
diff --git a/tv/tuner/1.1/default/Frontend.cpp b/tv/tuner/1.1/default/Frontend.cpp
index 971e335..7c6f8c6 100644
--- a/tv/tuner/1.1/default/Frontend.cpp
+++ b/tv/tuner/1.1/default/Frontend.cpp
@@ -122,9 +122,12 @@
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 b20e625..f8fe2aa 100644
--- a/tv/tuner/1.1/types.hal
+++ b/tv/tuner/1.1/types.hal
@@ -555,6 +555,11 @@
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 3bc7114..e5793c1 100644
--- a/tv/tuner/1.1/vts/functional/FrontendTests.cpp
+++ b/tv/tuner/1.1/vts/functional/FrontendTests.cpp
@@ -51,9 +51,12 @@
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;