Improve Tuner VTS Configuration: Dynamically determine possible
dataflows
This CL allows the VTS to read the contents of vendors'
configuration files and determine which dataflows can be tested
depending on the devices provided. This only implements the logic of
determining which data flows are possible. Currently, the data flow
section of the configuration file is still being read, and
configurations are not being cycled yet. Additionally, TearDown() was
overidden for each testing class.
Bug: b/182519645
Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest
Change-Id: Ib3b3c4de62e6556ef44b42e855a369a5015d66ff
diff --git a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
index b6e1020..7c757b4 100644
--- a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
+++ b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
@@ -62,10 +62,28 @@
using namespace aidl::android::hardware::tv::tuner;
using namespace android::media::tuner::testing::configuration::V1_0;
+static bool hasHwFe = false;
+static bool hasSwFe = false;
+static bool configFileRead = false;
+static bool configuredLive = false;
+static bool configuredScan = false;
+static bool configuredRecord = false;
+static bool configuredLnbLive = false;
+static bool configuredPlayback = false;
+static bool configuredLnbRecord = false;
+static bool configuredTimeFilter = false;
+static bool configuredDescrambling = false;
+
const string emptyHardwareId = "";
static string mConfigFilePath;
+static vector<string> playbackDvrIds;
+static vector<string> recordDvrIds;
+static vector<string> audioFilterIds;
+static vector<string> videoFilterIds;
+static vector<string> recordFilterIds;
+
#define PROVISION_STR \
"{ " \
" \"id\": 21140844, " \
@@ -310,6 +328,11 @@
}
frontendMap[id].type = type;
frontendMap[id].isSoftwareFe = feConfig.getIsSoftwareFrontend();
+ if (frontendMap[id].isSoftwareFe) {
+ hasSwFe = true;
+ } else {
+ hasHwFe = true;
+ }
// TODO: b/182519645 complete the tune status config
frontendMap[id].tuneStatusTypes = types;
frontendMap[id].expectTuneStatuses = statuses;
@@ -384,11 +407,13 @@
DvrType type;
switch (dvrConfig.getType()) {
case DvrTypeEnum::PLAYBACK:
+ playbackDvrIds.push_back(id);
type = DvrType::PLAYBACK;
dvrMap[id].settings.set<DvrSettings::Tag::playback>(
readPlaybackSettings(dvrConfig));
break;
case DvrTypeEnum::RECORD:
+ recordDvrIds.push_back(id);
type = DvrType::RECORD;
dvrMap[id].settings.set<DvrSettings::Tag::record>(
readRecordSettings(dvrConfig));
@@ -477,6 +502,7 @@
auto dataFlow = getDataFlowConfiguration();
if (dataFlow.hasClearLiveBroadcast()) {
live.hasFrontendConnection = true;
+ configuredLive = true;
} else {
live.hasFrontendConnection = false;
return;
@@ -510,6 +536,7 @@
auto dataFlow = getDataFlowConfiguration();
if (dataFlow.hasScan()) {
scan.hasFrontendConnection = true;
+ configuredScan = true;
} else {
scan.hasFrontendConnection = false;
return;
@@ -522,6 +549,7 @@
auto dataFlow = getDataFlowConfiguration();
if (dataFlow.hasDvrPlayback()) {
playback.support = true;
+ configuredPlayback = true;
} else {
playback.support = false;
return;
@@ -548,6 +576,7 @@
auto dataFlow = getDataFlowConfiguration();
if (dataFlow.hasDvrRecord()) {
record.support = true;
+ configuredRecord = true;
} else {
record.support = false;
return;
@@ -572,6 +601,7 @@
auto dataFlow = getDataFlowConfiguration();
if (dataFlow.hasDescrambling()) {
descrambling.support = true;
+ configuredDescrambling = true;
} else {
descrambling.support = false;
return;
@@ -601,6 +631,7 @@
auto dataFlow = getDataFlowConfiguration();
if (dataFlow.hasLnbLive()) {
lnbLive.support = true;
+ configuredLnbLive = true;
} else {
lnbLive.support = false;
return;
@@ -625,6 +656,7 @@
auto dataFlow = getDataFlowConfiguration();
if (dataFlow.hasLnbRecord()) {
lnbRecord.support = true;
+ configuredLnbRecord = true;
} else {
lnbRecord.support = false;
return;
@@ -649,6 +681,7 @@
auto dataFlow = getDataFlowConfiguration();
if (dataFlow.hasTimeFilter()) {
timeFilter.support = true;
+ configuredTimeFilter = true;
} else {
timeFilter.support = false;
return;
@@ -799,6 +832,14 @@
auto mainType = filterConfig.getMainType();
auto subType = filterConfig.getSubType();
+ if (subType == FilterSubTypeEnum::AUDIO) {
+ audioFilterIds.push_back(filterConfig.getId());
+ } else if (subType == FilterSubTypeEnum::VIDEO) {
+ videoFilterIds.push_back(filterConfig.getId());
+ } else if (subType == FilterSubTypeEnum::RECORD) {
+ recordFilterIds.push_back(filterConfig.getId());
+ }
+
switch (mainType) {
case FilterMainTypeEnum::TS: {
ALOGW("[ConfigReader] filter main type is ts");