blob: ff946394661852e88c0659398477639ac376e680 [file] [log] [blame]
Hongguang600a6ae2021-07-08 18:51:51 -07001/*
2 * Copyright 2021 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include <binder/MemoryDealer.h>
18
19#include "../../../config/TunerTestingConfigAidlReaderV1_0.h"
20
21#include <aidl/android/hardware/tv/tuner/DataFormat.h>
22#include <aidl/android/hardware/tv/tuner/DemuxAlpFilterType.h>
23#include <aidl/android/hardware/tv/tuner/DemuxFilterMainType.h>
24#include <aidl/android/hardware/tv/tuner/DemuxFilterMonitorEventType.h>
25#include <aidl/android/hardware/tv/tuner/DemuxFilterSettings.h>
26#include <aidl/android/hardware/tv/tuner/DemuxFilterType.h>
27#include <aidl/android/hardware/tv/tuner/DemuxIpAddress.h>
28#include <aidl/android/hardware/tv/tuner/DemuxIpFilterSettings.h>
29#include <aidl/android/hardware/tv/tuner/DemuxIpFilterType.h>
30#include <aidl/android/hardware/tv/tuner/DemuxMmtpFilterType.h>
31#include <aidl/android/hardware/tv/tuner/DemuxRecordScIndexType.h>
32#include <aidl/android/hardware/tv/tuner/DemuxTsFilterType.h>
33#include <aidl/android/hardware/tv/tuner/DvrSettings.h>
34#include <aidl/android/hardware/tv/tuner/DvrType.h>
35#include <aidl/android/hardware/tv/tuner/FrontendDvbtBandwidth.h>
36#include <aidl/android/hardware/tv/tuner/FrontendDvbtCoderate.h>
37#include <aidl/android/hardware/tv/tuner/FrontendDvbtConstellation.h>
38#include <aidl/android/hardware/tv/tuner/FrontendDvbtGuardInterval.h>
39#include <aidl/android/hardware/tv/tuner/FrontendDvbtHierarchy.h>
40#include <aidl/android/hardware/tv/tuner/FrontendDvbtSettings.h>
41#include <aidl/android/hardware/tv/tuner/FrontendDvbtStandard.h>
42#include <aidl/android/hardware/tv/tuner/FrontendDvbtTransmissionMode.h>
43#include <aidl/android/hardware/tv/tuner/FrontendSettings.h>
44#include <aidl/android/hardware/tv/tuner/FrontendType.h>
45#include <aidl/android/hardware/tv/tuner/PlaybackSettings.h>
46#include <aidl/android/hardware/tv/tuner/RecordSettings.h>
47
48using namespace std;
49using namespace aidl::android::hardware::tv::tuner;
50using namespace android::media::tuner::testing::configuration::V1_0;
51
52const int32_t FMQ_SIZE_4M = 0x400000;
53const int32_t FMQ_SIZE_16M = 0x1000000;
54
Hongguang16dacc12021-11-01 15:51:52 -070055const string configFilePath = "/vendor/etc/tuner_vts_config_aidl_V1.xml";
Hongguang600a6ae2021-07-08 18:51:51 -070056
57#define FILTER_MAIN_TYPE_BIT_COUNT 5
Ray Chin62ab6c92022-09-15 15:07:33 +080058#define STATUS_CHECK_INTERVAL_MS 100L
Hongguang600a6ae2021-07-08 18:51:51 -070059
60// Hardware configs
61static map<string, FrontendConfig> frontendMap;
62static map<string, FilterConfig> filterMap;
63static map<string, DvrConfig> dvrMap;
64static map<string, LnbConfig> lnbMap;
65static map<string, TimeFilterConfig> timeFilterMap;
66static map<string, vector<uint8_t>> diseqcMsgMap;
67static map<string, DescramblerConfig> descramblerMap;
68
69// Hardware and test cases connections
70static LiveBroadcastHardwareConnections live;
71static ScanHardwareConnections scan;
72static DvrPlaybackHardwareConnections playback;
73static DvrRecordHardwareConnections record;
74static DescramblingHardwareConnections descrambling;
75static LnbLiveHardwareConnections lnbLive;
76static LnbRecordHardwareConnections lnbRecord;
77static TimeFilterHardwareConnections timeFilter;
Frankie Lizcano523e5452022-07-27 22:21:16 +000078static LnbDescramblingHardwareConnections lnbDescrambling;
Hongguang600a6ae2021-07-08 18:51:51 -070079
Frankie Lizcanoa53f5542022-07-07 17:32:06 +000080/*
81 * This function takes in a 2d vector of device Id's
82 * The n vectors correlate to the ids for n different devices (eg frontends, filters)
83 * The resultant 2d vector is every combination of id's with 1 id from each vector
84 */
85inline vector<vector<string>> generateIdCombinations(vector<vector<string>>& ids) {
86 vector<vector<string>> combinations;
87
88 // The index of each vector in ids that will be used in the next combination
89 // EG {0, 2} means combo {ids[0][0] ids[1][2]} will be next
90 const int size = static_cast<int>(ids.size());
91 vector<int> indexes_used_in_combination(size, 0);
92
93 // The vector number from ids whose elements we will cycle through to make combinations.
94 // First, start at the right most vector
95 int cycled_vector = size - 1;
96
97 while (cycled_vector >= 0) {
98 // Make a combination (one at a time)
99 vector<string> combo;
100 for (size_t i = 0; i < indexes_used_in_combination.size(); ++i) {
101 const int combo_index = indexes_used_in_combination[i];
102 combo.push_back(ids[i][combo_index]);
103 }
104 combinations.push_back(combo);
105
106 // Find the right most vector that still has space [elements left] to cycle through and
107 // create a combination
108 while (cycled_vector >= 0 &&
109 indexes_used_in_combination[cycled_vector] == ids[cycled_vector].size() - 1) {
110 cycled_vector--;
111 }
112
113 // Use this check to avoid segmentation faults
114 if (cycled_vector >= 0) {
115 // Once found, we have a vector we can cycle through, so increase to its next element
116 indexes_used_in_combination[cycled_vector]++;
117
118 // Reset the other vectors to the right to their first element so we can cycle through
119 // them again with the new element from cycled vector
120 for (size_t i = cycled_vector + 1; i < indexes_used_in_combination.size(); ++i) {
121 indexes_used_in_combination[i] = 0;
122 }
123
124 // all the vectors to the right were reset, so we can cycle through them again
125 // Start at the furthest right vector
126 cycled_vector = size - 1;
127 }
128 }
129
130 return combinations;
131}
132
133/*
134 * index 0 - playback dvr
135 * index 1 - audio filters
Frankie Lizcano14aa8482022-07-26 16:50:35 +0000136 * index 2 - optional section filters
Frankie Lizcanoa53f5542022-07-07 17:32:06 +0000137 */
138static inline vector<DvrPlaybackHardwareConnections> generatePlaybackCombinations() {
139 vector<DvrPlaybackHardwareConnections> combinations;
140 vector<string> sectionFilterIds_optional = sectionFilterIds;
141 sectionFilterIds_optional.push_back(emptyHardwareId);
Frankie Lizcano14aa8482022-07-26 16:50:35 +0000142 vector<vector<string>> deviceIds{playbackDvrIds, audioFilterIds, sectionFilterIds_optional};
Frankie Lizcanoa53f5542022-07-07 17:32:06 +0000143
144 const int dvrIndex = 0;
145 const int audioFilterIndex = 1;
Frankie Lizcano14aa8482022-07-26 16:50:35 +0000146 const int sectionFilterIndex = 2;
Frankie Lizcanoa53f5542022-07-07 17:32:06 +0000147
148 auto idCombinations = generateIdCombinations(deviceIds);
149 for (auto& combo : idCombinations) {
150 DvrPlaybackHardwareConnections mPlayback;
151 mPlayback.dvrId = combo[dvrIndex];
152 mPlayback.audioFilterId = combo[audioFilterIndex];
Frankie Lizcanoa53f5542022-07-07 17:32:06 +0000153 mPlayback.sectionFilterId = combo[sectionFilterIndex];
Frankie Lizcano14aa8482022-07-26 16:50:35 +0000154 const int videoFilterIndex =
155 find(audioFilterIds.begin(), audioFilterIds.end(), mPlayback.audioFilterId) -
156 audioFilterIds.begin();
157 mPlayback.videoFilterId = videoFilterIds[videoFilterIndex];
Frankie Lizcanoa53f5542022-07-07 17:32:06 +0000158 combinations.push_back(mPlayback);
159 }
160
161 return combinations;
162}
163
164static inline vector<DvrPlaybackHardwareConnections> generatePlaybackConfigs() {
165 vector<DvrPlaybackHardwareConnections> playback_configs;
166 if (configuredPlayback) {
167 ALOGD("Using DVR playback configuration provided.");
168 playback_configs = {playback};
169 } else {
170 ALOGD("Dvr playback not provided. Generating possible combinations. Consider adding it to "
171 "the configuration file.");
172 playback_configs = generatePlaybackCombinations();
173 }
174
175 return playback_configs;
176}
177
Frankie Lizcano1e283b32022-07-08 21:07:42 +0000178/*
179 * index 0 - frontends
180 * index 1 - audio filters
Frankie Lizcano14aa8482022-07-26 16:50:35 +0000181 * index 2 - lnbs
Frankie Lizcano1e283b32022-07-08 21:07:42 +0000182 */
183static inline vector<LnbLiveHardwareConnections> generateLnbLiveCombinations() {
184 vector<LnbLiveHardwareConnections> combinations;
Frankie Lizcano14aa8482022-07-26 16:50:35 +0000185 vector<vector<string>> deviceIds{frontendIds, audioFilterIds, lnbIds};
Frankie Lizcano1e283b32022-07-08 21:07:42 +0000186
187 const int frontendIndex = 0;
188 const int audioFilterIndex = 1;
Frankie Lizcano14aa8482022-07-26 16:50:35 +0000189 const int lnbIndex = 2;
Frankie Lizcano1e283b32022-07-08 21:07:42 +0000190
191 // TODO: Find a better way to vary diseqcMsgs, if at all
192 auto idCombinations = generateIdCombinations(deviceIds);
193 for (auto& combo : idCombinations) {
194 const string feId = combo[frontendIndex];
195 auto type = frontendMap[feId].type;
196 if (type == FrontendType::DVBS || type == FrontendType::ISDBS ||
197 type == FrontendType::ISDBS3) {
198 LnbLiveHardwareConnections mLnbLive;
199 mLnbLive.frontendId = feId;
200 mLnbLive.audioFilterId = combo[audioFilterIndex];
Frankie Lizcano14aa8482022-07-26 16:50:35 +0000201 const int videoFilterIndex =
202 find(audioFilterIds.begin(), audioFilterIds.end(), mLnbLive.audioFilterId) -
203 audioFilterIds.begin();
204 mLnbLive.videoFilterId = videoFilterIds[videoFilterIndex];
Frankie Lizcano1e283b32022-07-08 21:07:42 +0000205 mLnbLive.lnbId = combo[lnbIndex];
206 mLnbLive.diseqcMsgs = diseqcMsgs;
207 combinations.push_back(mLnbLive);
208 }
209 }
210
211 return combinations;
212}
213
214static inline vector<LnbLiveHardwareConnections> generateLnbLiveConfigurations() {
215 vector<LnbLiveHardwareConnections> lnbLive_configs;
216 if (configuredLnbLive) {
217 ALOGD("Using LnbLive configuration provided.");
218 lnbLive_configs = {lnbLive};
219 } else {
220 ALOGD("LnbLive not provided. Generating possible combinations. Consider adding it to the "
221 "configuration file.");
222 lnbLive_configs = generateLnbLiveCombinations();
223 }
224
225 return lnbLive_configs;
226}
227
Frankie Lizcano3138d6b2022-07-11 22:06:45 +0000228static inline vector<ScanHardwareConnections> generateScanCombinations() {
229 vector<ScanHardwareConnections> combinations;
230
231 for (auto& id : frontendIds) {
232 ScanHardwareConnections mScan;
233 mScan.frontendId = id;
234 combinations.push_back(mScan);
235 }
236
237 return combinations;
238}
239
240static inline vector<ScanHardwareConnections> generateScanConfigurations() {
241 vector<ScanHardwareConnections> scan_configs;
242 if (configuredScan) {
243 ALOGD("Using scan configuration provided.");
244 scan_configs = {scan};
245 } else {
246 ALOGD("Scan not provided. Generating possible combinations. Consider adding it to "
247 "the configuration file.");
248 scan_configs = generateScanCombinations();
249 }
250
251 return scan_configs;
252}
253
Frankie Lizcanoecba02a2022-07-12 17:56:54 +0000254/*
255 * index 0 - frontends
256 * index 1 - record filter
257 * index 2 - Record Dvr
258 * index 3 - Lnb
259 */
260static inline vector<LnbRecordHardwareConnections> generateLnbRecordCombinations() {
261 vector<LnbRecordHardwareConnections> combinations;
262 vector<vector<string>> deviceIds{frontendIds, recordFilterIds, recordDvrIds, lnbIds};
263
264 const int frontendIndex = 0;
265 const int recordFilterIndex = 1;
266 const int dvrIndex = 2;
267 const int lnbIndex = 3;
268
269 auto idCombinations = generateIdCombinations(deviceIds);
270 // TODO : Find a better way to vary diseqcMsgs, if at all
271 for (auto& combo : idCombinations) {
272 const string feId = combo[frontendIndex];
273 auto type = frontendMap[feId].type;
274 if (type == FrontendType::DVBS || type == FrontendType::ISDBS ||
275 type == FrontendType::ISDBS3) {
276 LnbRecordHardwareConnections mLnbRecord;
277 mLnbRecord.frontendId = feId;
278 mLnbRecord.recordFilterId = combo[recordFilterIndex];
279 mLnbRecord.dvrRecordId = combo[dvrIndex];
280 mLnbRecord.lnbId = combo[lnbIndex];
281 mLnbRecord.diseqcMsgs = diseqcMsgs;
282 combinations.push_back(mLnbRecord);
283 }
284 }
285
286 return combinations;
287}
288
289static inline vector<LnbRecordHardwareConnections> generateLnbRecordConfigurations() {
290 vector<LnbRecordHardwareConnections> lnbRecord_configs;
291 if (configuredLnbRecord) {
292 ALOGD("Using LnbRecord configuration provided.");
293 lnbRecord_configs = {lnbRecord};
294 } else {
295 ALOGD("LnbRecord not provided. Generating possible combinations. Consider adding it to "
296 "the configuration file.");
297 lnbRecord_configs = generateLnbRecordCombinations();
298 }
299
300 return lnbRecord_configs;
301}
302
Frankie Lizcanof4e07962022-07-13 20:54:34 +0000303/*
304 * index 0 - decramblers
305 * index 1 - frontends
306 * index 2 - audio filters
Frankie Lizcano14aa8482022-07-26 16:50:35 +0000307 * index 3 - Dvr SW Fe Connections
308 * index 4 - DVR Source Connections
Frankie Lizcanof4e07962022-07-13 20:54:34 +0000309 */
310static inline vector<DescramblingHardwareConnections> generateDescramblingCombinations() {
311 vector<DescramblingHardwareConnections> combinations;
312 vector<string> mfrontendIds = frontendIds;
313 vector<string> mDvrFeConnectionIds = playbackDvrIds;
314 vector<string> mDvrSourceConnectionIds = playbackDvrIds;
315
316 // Add the empty hardware id to each vector to include combinations where these 3 fields might
317 // be optional
318 mfrontendIds.push_back(emptyHardwareId);
319 mDvrFeConnectionIds.push_back(emptyHardwareId);
320 mDvrSourceConnectionIds.push_back(emptyHardwareId);
321
322 const int descramblerIndex = 0;
323 const int frontendIndex = 1;
324 const int audioFilterIndex = 2;
Frankie Lizcano14aa8482022-07-26 16:50:35 +0000325 const int dvrFeIdIndex = 3;
326 const int dvrSourceIdIndex = 4;
Frankie Lizcanof4e07962022-07-13 20:54:34 +0000327
Frankie Lizcano14aa8482022-07-26 16:50:35 +0000328 vector<vector<string>> deviceIds{descramblerIds, mfrontendIds, audioFilterIds,
329 mDvrFeConnectionIds, mDvrSourceConnectionIds};
Frankie Lizcanof4e07962022-07-13 20:54:34 +0000330 auto idCombinations = generateIdCombinations(deviceIds);
331 for (auto& combo : idCombinations) {
332 DescramblingHardwareConnections mDescrambling;
333 const string feId = combo[frontendIndex];
334 const string dvrSwFeId = combo[dvrFeIdIndex];
335 const string dvrSourceId = combo[dvrSourceIdIndex];
336 mDescrambling.hasFrontendConnection = feId.compare(emptyHardwareId) == 0 ? false : true;
337 if (!mDescrambling.hasFrontendConnection) {
338 if (dvrSourceId.compare(emptyHardwareId) == 0) {
339 // If combination does not have a frontend or dvr source connection, do not include
340 // it
341 continue;
342 }
343 } else {
344 if (frontendMap[feId].isSoftwareFe && dvrSwFeId.compare(emptyHardwareId) == 0) {
345 // If combination has a software frontend and no dvr->software frontend connection,
346 // do not include it
347 continue;
348 }
349 }
350 if (dvrSwFeId.compare(dvrSourceId) == 0) {
351 // If dvr->software frontend connection is the same as dvr source input to tuner, do not
352 // include it.
353 continue;
354 }
355 mDescrambling.frontendId = feId;
356 mDescrambling.audioFilterId = combo[audioFilterIndex];
Frankie Lizcano14aa8482022-07-26 16:50:35 +0000357 const int videoFilterIndex =
358 find(audioFilterIds.begin(), audioFilterIds.end(), mDescrambling.audioFilterId) -
359 audioFilterIds.begin();
360 mDescrambling.videoFilterId = videoFilterIds[videoFilterIndex];
Frankie Lizcanof4e07962022-07-13 20:54:34 +0000361 mDescrambling.dvrSoftwareFeId = dvrSwFeId;
362 mDescrambling.dvrSourceId = dvrSourceId;
363 mDescrambling.descramblerId = combo[descramblerIndex];
364 combinations.push_back(mDescrambling);
365 }
366
367 return combinations;
368}
369
370static inline vector<DescramblingHardwareConnections> generateDescramblingConfigurations() {
371 vector<DescramblingHardwareConnections> descrambling_configs;
372 if (configuredDescrambling) {
373 ALOGD("Using Descrambling configuration provided.");
374 descrambling_configs = {descrambling};
375 } else {
376 ALOGD("Descrambling not provided. Generating possible combinations. Consider adding it to "
377 "the "
378 "configuration file.");
379 descrambling_configs = generateDescramblingCombinations();
380 }
381
382 return descrambling_configs;
383}
384
Frankie Lizcano0c069532022-07-14 20:20:46 +0000385static inline vector<TimeFilterHardwareConnections> generateTimeFilterCombinations() {
386 vector<TimeFilterHardwareConnections> combinations;
387
388 for (auto& id : timeFilterIds) {
389 TimeFilterHardwareConnections mTimeFilter;
390 mTimeFilter.timeFilterId = id;
391 combinations.push_back(mTimeFilter);
392 }
393
394 return combinations;
395}
396
397static inline vector<TimeFilterHardwareConnections> generateTimeFilterConfigurations() {
398 vector<TimeFilterHardwareConnections> timeFilter_configs;
399 if (configuredTimeFilter) {
400 ALOGD("Using TimeFilter configuration provided.");
401 timeFilter_configs = {timeFilter};
402 } else {
403 ALOGD("TimeFilter not provided. Generating possible combinations. Consider adding it to "
404 "the "
405 "configuration file.");
406 timeFilter_configs = generateTimeFilterCombinations();
407 }
408
409 return timeFilter_configs;
410}
411
Frankie Lizcano9c464f72022-07-18 17:56:52 +0000412/*
413 * index 0 - frontends
414 * index 1 - record dvrs
415 * index 2 - record filters
416 */
417static inline vector<DvrRecordHardwareConnections> generateRecordCombinations() {
418 vector<DvrRecordHardwareConnections> combinations;
419
420 const int frontendIdIndex = 0;
421 const int recordDvrIndex = 1;
422 const int recordFilterIndex = 2;
423
424 vector<vector<string>> deviceIds{frontendIds, recordDvrIds, recordFilterIds};
425
426 auto idCombinations = generateIdCombinations(deviceIds);
427 for (auto& combo : idCombinations) {
428 DvrRecordHardwareConnections mRecord;
429 const string feId = combo[frontendIdIndex];
430 mRecord.hasFrontendConnection = true;
431 if (frontendMap[feId].isSoftwareFe) {
432 // If we have a software frontend, do not include configuration for testing.
433 continue;
434 }
435 mRecord.frontendId = feId;
436 mRecord.support = true;
437 mRecord.dvrSourceId = emptyHardwareId;
438 mRecord.dvrSoftwareFeId = emptyHardwareId;
439 mRecord.recordFilterId = combo[recordFilterIndex];
440 mRecord.dvrRecordId = combo[recordDvrIndex];
441 combinations.push_back(mRecord);
442 }
443
444 return combinations;
445}
446
447static inline vector<DvrRecordHardwareConnections> generateRecordConfigurations() {
448 vector<DvrRecordHardwareConnections> record_configs;
449 if (configuredRecord) {
450 ALOGD("Using Record configuration provided.");
451 record_configs = {record};
452 } else {
453 ALOGD("Record not provided. Generating possible combinations. Consider adding it to "
454 "the "
455 "configuration file.");
456 record_configs = generateRecordCombinations();
457 }
458
459 return record_configs;
460}
461
Frankie Lizcano8b87f252022-07-19 21:51:54 +0000462/*
463 * index 0 - frontends
464 * index 1 - audio filters
465 * index 2 - playback dvrs
466 * index 3 - section Filters
467 */
468static inline vector<LiveBroadcastHardwareConnections> generateLiveCombinations() {
469 vector<LiveBroadcastHardwareConnections> combinations;
470 vector<string> mSectionFilterIds = sectionFilterIds;
471 vector<string> mDvrSwConnectionIds = playbackDvrIds;
472
473 // Adding the empty hardware id to cover cases where fields are optional
474 mSectionFilterIds.push_back(emptyHardwareId);
475 mDvrSwConnectionIds.push_back(emptyHardwareId);
476
477 const int frontendIdIndex = 0;
478 const int audioFilterIdIndex = 1;
479 const int dvrSwConnectionIdIndex = 2;
480 const int sectionFilterIdIndex = 3;
481
482 vector<vector<string>> deviceIds{frontendIds, audioFilterIds, mDvrSwConnectionIds,
483 mSectionFilterIds};
484
485 auto idCombinations = generateIdCombinations(deviceIds);
486 for (auto& combo : idCombinations) {
487 LiveBroadcastHardwareConnections mLive;
488 const string feId = combo[frontendIdIndex];
489 const string dvrSwConnectionId = combo[dvrSwConnectionIdIndex];
490 mLive.hasFrontendConnection = true;
491
492 if (frontendMap[feId].isSoftwareFe && dvrSwConnectionId.compare(emptyHardwareId) == 0) {
493 // If the frontend is a software frontend and there is no dvr playback connected, do not
494 // include configuration
495 continue;
496 }
497 mLive.frontendId = feId;
498 mLive.dvrSoftwareFeId = dvrSwConnectionId;
499 mLive.audioFilterId = combo[audioFilterIdIndex];
500 const int videoFilterIdIndex =
501 find(audioFilterIds.begin(), audioFilterIds.end(), mLive.audioFilterId) -
502 audioFilterIds.begin();
503 mLive.videoFilterId = videoFilterIds[videoFilterIdIndex];
504 mLive.sectionFilterId = combo[sectionFilterIdIndex];
505
506 if (pcrFilterIds.empty()) {
507 // If pcr Filters have not been provided, set it to empty hardware id
508 mLive.pcrFilterId = emptyHardwareId;
509 } else {
510 // If pcr Filters have been provided, use the first index if there is only 1, or choose
511 // the filter that corresponds to the correct audio and video filter pair
512 const int pcrFilterIdIndex = pcrFilterIds.size() == 1 ? 0 : videoFilterIdIndex;
513 mLive.pcrFilterId = pcrFilterIds[pcrFilterIdIndex];
514 }
515
516 combinations.push_back(mLive);
517 }
518
519 return combinations;
520}
521
522static inline vector<LiveBroadcastHardwareConnections> generateLiveConfigurations() {
523 vector<LiveBroadcastHardwareConnections> live_configs;
524 if (configuredLive) {
525 ALOGD("Using Live configuration provided.");
526 live_configs = {live};
527 } else {
528 ALOGD("Live not provided. Generating possible combinations. Consider adding it to "
529 "the "
530 "configuration file.");
531 live_configs = generateLiveCombinations();
532 }
533
534 return live_configs;
535}
536
Frankie Lizcanobcf4ebb2022-08-01 18:06:00 +0000537static inline vector<LnbDescramblingHardwareConnections> generateLnbDescramblingCombinations() {
538 vector<LnbDescramblingHardwareConnections> combinations;
539 vector<vector<string>> deviceIds{frontendIds, audioFilterIds, lnbIds, descramblerIds};
540
541 const int frontendIdIndex = 0;
542 const int audioFilterIdIndex = 1;
543 const int lnbIdIndex = 2;
544 const int descramblerIdIndex = 3;
545
546 auto idCombinations = generateIdCombinations(deviceIds);
547 // TODO : Find a better way to vary diseqcMsgs, if at all
548 for (auto& combo : idCombinations) {
549 const string feId = combo[frontendIdIndex];
550 auto type = frontendMap[feId].type;
551 if (type == FrontendType::DVBS || type == FrontendType::ISDBS ||
552 type == FrontendType::ISDBS3) {
553 LnbDescramblingHardwareConnections mLnbDescrambling;
554 mLnbDescrambling.support = true;
555 mLnbDescrambling.frontendId = feId;
556 mLnbDescrambling.audioFilterId = combo[audioFilterIdIndex];
557 const int videoFilterIdIndex = find(audioFilterIds.begin(), audioFilterIds.end(),
558 mLnbDescrambling.audioFilterId) -
559 audioFilterIds.begin();
560 mLnbDescrambling.videoFilterId = videoFilterIds[videoFilterIdIndex];
561 mLnbDescrambling.lnbId = combo[lnbIdIndex];
562 mLnbDescrambling.descramblerId = combo[descramblerIdIndex];
563 mLnbDescrambling.diseqcMsgs = diseqcMsgs;
564 combinations.push_back(mLnbDescrambling);
565 }
566 }
567
568 return combinations;
569}
570
571static inline vector<LnbDescramblingHardwareConnections> generateLnbDescramblingConfigurations() {
572 vector<LnbDescramblingHardwareConnections> lnbDescrambling_configs;
573 if (configuredLnbDescrambling) {
574 ALOGD("Using LnbDescrambling configuration provided");
575 lnbDescrambling_configs = {lnbDescrambling};
576 } else {
577 ALOGD("LnbDescrambling not provided. Generating possible combinations. Consider adding it "
578 "to the configuration file.");
579 lnbDescrambling_configs = generateLnbDescramblingCombinations();
580 }
581
582 return lnbDescrambling_configs;
583}
584
Hongguang600a6ae2021-07-08 18:51:51 -0700585/** Config all the frontends that would be used in the tests */
586inline void initFrontendConfig() {
587 // The test will use the internal default fe when default fe is connected to any data flow
588 // without overriding in the xml config.
589 string defaultFeId = "FE_DEFAULT";
590 FrontendDvbtSettings dvbtSettings{
Gareth Fenn282fb372021-09-27 15:14:11 +0100591 .frequency = 578000000,
Hongguang600a6ae2021-07-08 18:51:51 -0700592 .transmissionMode = FrontendDvbtTransmissionMode::AUTO,
593 .bandwidth = FrontendDvbtBandwidth::BANDWIDTH_8MHZ,
594 .isHighPriority = true,
595 };
596 frontendMap[defaultFeId].type = FrontendType::DVBT;
597 frontendMap[defaultFeId].settings.set<FrontendSettings::Tag::dvbt>(dvbtSettings);
598
599 vector<FrontendStatusType> types;
600 types.push_back(FrontendStatusType::UEC);
601 types.push_back(FrontendStatusType::IS_MISO);
602
603 vector<FrontendStatus> statuses;
604 FrontendStatus status;
605 status.set<FrontendStatus::Tag::uec>(4);
606 statuses.push_back(status);
607 status.set<FrontendStatus::Tag::isMiso>(true);
608 statuses.push_back(status);
609
610 frontendMap[defaultFeId].tuneStatusTypes = types;
611 frontendMap[defaultFeId].expectTuneStatuses = statuses;
612 frontendMap[defaultFeId].isSoftwareFe = true;
613 frontendMap[defaultFeId].canConnectToCiCam = true;
614 frontendMap[defaultFeId].ciCamId = 0;
Ray Chin58be11e2023-12-22 19:10:46 +0800615 frontendMap[defaultFeId].supportBlindScan = true;
Hongguang600a6ae2021-07-08 18:51:51 -0700616 FrontendDvbtSettings dvbt;
617 dvbt.transmissionMode = FrontendDvbtTransmissionMode::MODE_8K_E;
618 frontendMap[defaultFeId].settings.set<FrontendSettings::Tag::dvbt>(dvbt);
619 // Read customized config
620 TunerTestingConfigAidlReader1_0::readFrontendConfig1_0(frontendMap);
621};
622
623inline void initFilterConfig() {
624 // The test will use the internal default filter when default filter is connected to any
625 // data flow without overriding in the xml config.
626 string defaultAudioFilterId = "FILTER_AUDIO_DEFAULT";
627 string defaultVideoFilterId = "FILTER_VIDEO_DEFAULT";
628
629 filterMap[defaultVideoFilterId].type.mainType = DemuxFilterMainType::TS;
Hongguangce1e30d2021-08-02 21:55:44 -0700630 filterMap[defaultVideoFilterId].type.subType.set<DemuxFilterSubType::Tag::tsFilterType>(
631 DemuxTsFilterType::VIDEO);
Hongguang600a6ae2021-07-08 18:51:51 -0700632 filterMap[defaultVideoFilterId].bufferSize = FMQ_SIZE_16M;
633 filterMap[defaultVideoFilterId].settings =
634 DemuxFilterSettings::make<DemuxFilterSettings::Tag::ts>();
635 filterMap[defaultVideoFilterId].settings.get<DemuxFilterSettings::Tag::ts>().tpid = 256;
636 DemuxFilterAvSettings video;
637 video.isPassthrough = false;
638 filterMap[defaultVideoFilterId]
639 .settings.get<DemuxFilterSettings::Tag::ts>()
640 .filterSettings.set<DemuxTsFilterSettingsFilterSettings::Tag::av>(video);
641 filterMap[defaultVideoFilterId].monitorEventTypes =
642 static_cast<int32_t>(DemuxFilterMonitorEventType::SCRAMBLING_STATUS) |
643 static_cast<int32_t>(DemuxFilterMonitorEventType::IP_CID_CHANGE);
644 filterMap[defaultVideoFilterId].streamType.set<AvStreamType::Tag::video>(
645 VideoStreamType::MPEG1);
646
647 filterMap[defaultAudioFilterId].type.mainType = DemuxFilterMainType::TS;
Hongguangce1e30d2021-08-02 21:55:44 -0700648 filterMap[defaultAudioFilterId].type.subType.set<DemuxFilterSubType::Tag::tsFilterType>(
649 DemuxTsFilterType::AUDIO);
Hongguang600a6ae2021-07-08 18:51:51 -0700650 filterMap[defaultAudioFilterId].bufferSize = FMQ_SIZE_16M;
651 filterMap[defaultAudioFilterId].settings =
652 DemuxFilterSettings::make<DemuxFilterSettings::Tag::ts>();
653 filterMap[defaultAudioFilterId].settings.get<DemuxFilterSettings::Tag::ts>().tpid = 256;
654 DemuxFilterAvSettings audio;
655 audio.isPassthrough = false;
656 filterMap[defaultAudioFilterId]
657 .settings.get<DemuxFilterSettings::Tag::ts>()
658 .filterSettings.set<DemuxTsFilterSettingsFilterSettings::Tag::av>(audio);
659 filterMap[defaultAudioFilterId].monitorEventTypes =
660 static_cast<int32_t>(DemuxFilterMonitorEventType::SCRAMBLING_STATUS) |
661 static_cast<int32_t>(DemuxFilterMonitorEventType::IP_CID_CHANGE);
662 filterMap[defaultAudioFilterId].streamType.set<AvStreamType::Tag::audio>(AudioStreamType::MP3);
663 // Read customized config
664 TunerTestingConfigAidlReader1_0::readFilterConfig1_0(filterMap);
665};
666
667/** Config all the dvrs that would be used in the tests */
668inline void initDvrConfig() {
669 // Read customized config
670 TunerTestingConfigAidlReader1_0::readDvrConfig1_0(dvrMap);
671};
672
Frankie Lizcano1fd52972022-06-30 16:50:21 +0000673inline void initTimeFilterConfig() {
674 // Read customized config
675 TunerTestingConfigAidlReader1_0::readTimeFilterConfig1_0(timeFilterMap);
676};
677
Frankie Lizcanof5352122022-06-29 22:10:16 +0000678inline void initDescramblerConfig() {
679 // Read customized config
680 TunerTestingConfigAidlReader1_0::readDescramblerConfig1_0(descramblerMap);
681}
682
Frankie Lizcano647d5aa2022-06-30 20:49:31 +0000683inline void initLnbConfig() {
684 // Read customized config
685 TunerTestingConfigAidlReader1_0::readLnbConfig1_0(lnbMap);
686};
687
688inline void initDiseqcMsgsConfig() {
689 // Read customized config
690 TunerTestingConfigAidlReader1_0::readDiseqcMessages(diseqcMsgMap);
691};
692
Frankie Lizcano5b29f502022-07-06 22:09:42 +0000693inline void determineScan() {
694 if (!frontendMap.empty()) {
695 scan.hasFrontendConnection = true;
696 ALOGD("Can support scan");
697 }
698}
699
700inline void determineTimeFilter() {
701 if (!timeFilterMap.empty()) {
702 timeFilter.support = true;
703 ALOGD("Can support time filter");
704 }
705}
706
707inline void determineDvrPlayback() {
708 if (!playbackDvrIds.empty() && !audioFilterIds.empty() && !videoFilterIds.empty()) {
709 playback.support = true;
710 ALOGD("Can support dvr playback");
711 }
712}
713
714inline void determineLnbLive() {
715 if (!audioFilterIds.empty() && !videoFilterIds.empty() && !frontendMap.empty() &&
716 !lnbMap.empty()) {
717 lnbLive.support = true;
718 ALOGD("Can support lnb live");
719 }
720}
721
722inline void determineLnbRecord() {
723 if (!frontendMap.empty() && !recordFilterIds.empty() && !recordDvrIds.empty() &&
724 !lnbMap.empty()) {
725 lnbRecord.support = true;
726 ALOGD("Can support lnb record");
727 }
728}
729
730inline void determineLive() {
731 if (videoFilterIds.empty() || audioFilterIds.empty() || frontendMap.empty()) {
732 return;
733 }
Ray Chinaeaabf32024-01-25 16:52:18 +0800734 if (!hasHwFe) {
735 if (hasSwFe) {
736 if (dvrMap.empty()) {
737 ALOGD("Cannot configure Live. Only software frontends and no dvr connections.");
738 return;
739 }
740 // Live is available if there is SW FE and some DVR is attached.
741 } else {
742 // We will arrive here because frontendMap won't be empty since
743 // there will be at least a default frontend declared. But the
744 // default frontend doesn't count as "hasSwFe".
745 ALOGD("Cannot configure Live. No frontend declared at all.");
746 return;
747 }
Frankie Lizcano5b29f502022-07-06 22:09:42 +0000748 }
749 ALOGD("Can support live");
750 live.hasFrontendConnection = true;
751}
752
753inline void determineDescrambling() {
754 if (descramblerMap.empty() || audioFilterIds.empty() || videoFilterIds.empty()) {
755 return;
756 }
757 if (frontendMap.empty() && playbackDvrIds.empty()) {
758 ALOGD("Cannot configure descrambling. No frontends or playback dvr's");
759 return;
760 }
761 if (hasSwFe && !hasHwFe && playbackDvrIds.empty()) {
762 ALOGD("cannot configure descrambling. Only SW frontends and no playback dvr's");
763 return;
764 }
765 ALOGD("Can support descrambling");
766 descrambling.support = true;
767}
768
769inline void determineDvrRecord() {
770 if (recordDvrIds.empty() || recordFilterIds.empty()) {
771 return;
772 }
773 if (frontendMap.empty() && playbackDvrIds.empty()) {
Frankie Lizcanoecba02a2022-07-12 17:56:54 +0000774 ALOGD("Cannot support dvr record. No frontends and no playback dvr's");
Frankie Lizcano5b29f502022-07-06 22:09:42 +0000775 return;
776 }
777 if (hasSwFe && !hasHwFe && playbackDvrIds.empty()) {
778 ALOGD("Cannot support dvr record. Only SW frontends and no playback dvr's");
779 return;
780 }
781 ALOGD("Can support dvr record.");
782 record.support = true;
783}
784
Frankie Lizcanobcf4ebb2022-08-01 18:06:00 +0000785inline void determineLnbDescrambling() {
786 if (frontendIds.empty() || audioFilterIds.empty() || videoFilterIds.empty() || lnbIds.empty() ||
787 descramblerIds.empty()) {
788 return;
789 }
790 ALOGD("Can support LnbDescrambling.");
791 lnbDescrambling.support = true;
792}
793
Hongguang600a6ae2021-07-08 18:51:51 -0700794/** Read the vendor configurations of which hardware to use for each test cases/data flows */
795inline void connectHardwaresToTestCases() {
796 TunerTestingConfigAidlReader1_0::connectLiveBroadcast(live);
797 TunerTestingConfigAidlReader1_0::connectScan(scan);
798 TunerTestingConfigAidlReader1_0::connectDvrRecord(record);
Frankie Lizcano1fd52972022-06-30 16:50:21 +0000799 TunerTestingConfigAidlReader1_0::connectTimeFilter(timeFilter);
Frankie Lizcanof5352122022-06-29 22:10:16 +0000800 TunerTestingConfigAidlReader1_0::connectDescrambling(descrambling);
Frankie Lizcano1e283b32022-07-08 21:07:42 +0000801 TunerTestingConfigAidlReader1_0::connectLnbLive(lnbLive);
Frankie Lizcano3138d6b2022-07-11 22:06:45 +0000802 TunerTestingConfigAidlReader1_0::connectLnbRecord(lnbRecord);
Frankie Lizcano50461932022-06-28 21:36:26 +0000803 TunerTestingConfigAidlReader1_0::connectDvrPlayback(playback);
Frankie Lizcano523e5452022-07-27 22:21:16 +0000804 TunerTestingConfigAidlReader1_0::connectLnbDescrambling(lnbDescrambling);
Hongguang600a6ae2021-07-08 18:51:51 -0700805};
806
Frankie Lizcano5b29f502022-07-06 22:09:42 +0000807inline void determineDataFlows() {
808 determineScan();
809 determineTimeFilter();
810 determineDvrPlayback();
811 determineLnbLive();
812 determineLnbRecord();
813 determineLive();
814 determineDescrambling();
815 determineDvrRecord();
Frankie Lizcanobcf4ebb2022-08-01 18:06:00 +0000816 determineLnbDescrambling();
Frankie Lizcano5b29f502022-07-06 22:09:42 +0000817}
818
Hongguang600a6ae2021-07-08 18:51:51 -0700819inline bool validateConnections() {
820 if (record.support && !record.hasFrontendConnection &&
821 record.dvrSourceId.compare(emptyHardwareId) == 0) {
822 ALOGW("[vts config] Record must support either a DVR source or a Frontend source.");
823 return false;
824 }
Gareth Fenn9a808452022-03-31 08:40:00 +0100825 bool feIsValid = live.hasFrontendConnection
826 ? frontendMap.find(live.frontendId) != frontendMap.end()
827 : true;
828 feIsValid &= scan.hasFrontendConnection ? frontendMap.find(scan.frontendId) != frontendMap.end()
829 : true;
830 feIsValid &= record.support && record.hasFrontendConnection
831 ? frontendMap.find(record.frontendId) != frontendMap.end()
832 : true;
Frankie Lizcanof5352122022-06-29 22:10:16 +0000833 feIsValid &= descrambling.support && descrambling.hasFrontendConnection
834 ? frontendMap.find(descrambling.frontendId) != frontendMap.end()
835 : true;
Hongguang600a6ae2021-07-08 18:51:51 -0700836
Frankie Lizcano647d5aa2022-06-30 20:49:31 +0000837 feIsValid &= lnbLive.support ? frontendMap.find(lnbLive.frontendId) != frontendMap.end() : true;
838
839 feIsValid &=
840 lnbRecord.support ? frontendMap.find(lnbRecord.frontendId) != frontendMap.end() : true;
841
Frankie Lizcano523e5452022-07-27 22:21:16 +0000842 feIsValid &= lnbDescrambling.support
843 ? frontendMap.find(lnbDescrambling.frontendId) != frontendMap.end()
844 : true;
845
Hongguang600a6ae2021-07-08 18:51:51 -0700846 if (!feIsValid) {
847 ALOGW("[vts config] dynamic config fe connection is invalid.");
848 return false;
849 }
850
851 bool dvrIsValid = frontendMap[live.frontendId].isSoftwareFe
852 ? dvrMap.find(live.dvrSoftwareFeId) != dvrMap.end()
853 : true;
854
855 if (record.support) {
856 if (record.hasFrontendConnection) {
857 if (frontendMap[record.frontendId].isSoftwareFe) {
858 dvrIsValid &= dvrMap.find(record.dvrSoftwareFeId) != dvrMap.end();
859 }
860 } else {
861 dvrIsValid &= dvrMap.find(record.dvrSourceId) != dvrMap.end();
862 }
863 dvrIsValid &= dvrMap.find(record.dvrRecordId) != dvrMap.end();
864 }
865
Frankie Lizcanof5352122022-06-29 22:10:16 +0000866 if (descrambling.support) {
867 if (descrambling.hasFrontendConnection) {
868 if (frontendMap[descrambling.frontendId].isSoftwareFe) {
869 dvrIsValid &= dvrMap.find(descrambling.dvrSoftwareFeId) != dvrMap.end();
870 }
871 } else {
872 dvrIsValid &= dvrMap.find(descrambling.dvrSourceId) != dvrMap.end();
873 }
874 }
875
Frankie Lizcano647d5aa2022-06-30 20:49:31 +0000876 dvrIsValid &= lnbRecord.support ? dvrMap.find(lnbRecord.dvrRecordId) != dvrMap.end() : true;
877
Frankie Lizcano50461932022-06-28 21:36:26 +0000878 dvrIsValid &= playback.support ? dvrMap.find(playback.dvrId) != dvrMap.end() : true;
879
Hongguang600a6ae2021-07-08 18:51:51 -0700880 if (!dvrIsValid) {
881 ALOGW("[vts config] dynamic config dvr connection is invalid.");
882 return false;
883 }
884
Gareth Fenn9a808452022-03-31 08:40:00 +0100885 bool filterIsValid = (live.hasFrontendConnection)
886 ? filterMap.find(live.audioFilterId) != filterMap.end() &&
887 filterMap.find(live.videoFilterId) != filterMap.end()
888 : true;
Hongguang600a6ae2021-07-08 18:51:51 -0700889 filterIsValid &=
890 record.support ? filterMap.find(record.recordFilterId) != filterMap.end() : true;
891
Frankie Lizcanof5352122022-06-29 22:10:16 +0000892 filterIsValid &= descrambling.support
893 ? filterMap.find(descrambling.videoFilterId) != filterMap.end() &&
894 filterMap.find(descrambling.audioFilterId) != filterMap.end()
895 : true;
896
897 for (auto& filterId : descrambling.extraFilters) {
898 filterIsValid &= filterMap.find(filterId) != filterMap.end();
899 }
900
Frankie Lizcano647d5aa2022-06-30 20:49:31 +0000901 filterIsValid &= lnbLive.support
902 ? filterMap.find(lnbLive.audioFilterId) != filterMap.end() &&
903 filterMap.find(lnbLive.videoFilterId) != filterMap.end()
904 : true;
905
906 filterIsValid &=
907 lnbRecord.support ? filterMap.find(lnbRecord.recordFilterId) != filterMap.end() : true;
908
909 for (auto& filterId : lnbRecord.extraFilters) {
910 filterIsValid &= filterMap.find(filterId) != filterMap.end();
911 }
912
913 for (auto& filterId : lnbLive.extraFilters) {
914 filterIsValid &= filterMap.find(filterId) != filterMap.end();
915 }
916
Frankie Lizcano50461932022-06-28 21:36:26 +0000917 filterIsValid &= playback.support
918 ? filterMap.find(playback.audioFilterId) != filterMap.end() &&
919 filterMap.find(playback.videoFilterId) != filterMap.end()
920 : true;
921 filterIsValid &= playback.sectionFilterId.compare(emptyHardwareId) == 0
922 ? true
923 : filterMap.find(playback.sectionFilterId) != filterMap.end();
924
925 for (auto& filterId : playback.extraFilters) {
926 filterIsValid &=
927 playback.hasExtraFilters ? filterMap.find(filterId) != filterMap.end() : true;
928 }
929
Frankie Lizcano523e5452022-07-27 22:21:16 +0000930 filterIsValid &=
931 lnbDescrambling.support
932 ? filterMap.find(lnbDescrambling.audioFilterId) != filterMap.end() &&
933 filterMap.find(lnbDescrambling.videoFilterId) != filterMap.end()
934 : true;
935
Hongguang600a6ae2021-07-08 18:51:51 -0700936 if (!filterIsValid) {
937 ALOGW("[vts config] dynamic config filter connection is invalid.");
938 return false;
939 }
940
Frankie Lizcano14aa8482022-07-26 16:50:35 +0000941 if (audioFilterIds.size() != videoFilterIds.size()) {
942 ALOGW("[vts config] the number of audio and video filters should be equal");
943 return false;
944 }
945
Frankie Lizcano8b87f252022-07-19 21:51:54 +0000946 if (!pcrFilterIds.empty() && pcrFilterIds.size() != 1 &&
947 pcrFilterIds.size() != audioFilterIds.size()) {
948 ALOGW("[vts config] When more than 1 pcr filter is configured, the number of pcr filters "
949 "must equal the number of audio and video filters.");
950 return false;
951 }
952
Frankie Lizcano1fd52972022-06-30 16:50:21 +0000953 bool timeFilterIsValid =
954 timeFilter.support ? timeFilterMap.find(timeFilter.timeFilterId) != timeFilterMap.end()
955 : true;
956
957 if (!timeFilterIsValid) {
958 ALOGW("[vts config] dynamic config time filter connection is invalid.");
Frankie Lizcanof5352122022-06-29 22:10:16 +0000959 }
960
961 bool descramblerIsValid =
962 descrambling.support
963 ? descramblerMap.find(descrambling.descramblerId) != descramblerMap.end()
964 : true;
965
Frankie Lizcano523e5452022-07-27 22:21:16 +0000966 descramblerIsValid &=
967 lnbDescrambling.support
968 ? descramblerMap.find(lnbDescrambling.descramblerId) != descramblerMap.end()
969 : true;
970
Frankie Lizcanof5352122022-06-29 22:10:16 +0000971 if (!descramblerIsValid) {
972 ALOGW("[vts config] dynamic config descrambler connection is invalid.");
Frankie Lizcano1fd52972022-06-30 16:50:21 +0000973 return false;
974 }
975
Frankie Lizcano647d5aa2022-06-30 20:49:31 +0000976 bool lnbIsValid = lnbLive.support ? lnbMap.find(lnbLive.lnbId) != lnbMap.end() : true;
977
978 lnbIsValid &= lnbRecord.support ? lnbMap.find(lnbRecord.lnbId) != lnbMap.end() : true;
979
Frankie Lizcano523e5452022-07-27 22:21:16 +0000980 lnbIsValid &=
981 lnbDescrambling.support ? lnbMap.find(lnbDescrambling.lnbId) != lnbMap.end() : true;
982
Frankie Lizcano647d5aa2022-06-30 20:49:31 +0000983 if (!lnbIsValid) {
984 ALOGW("[vts config] dynamic config lnb connection is invalid.");
985 return false;
986 }
987
988 bool diseqcMsgsIsValid = true;
989
990 for (auto& msg : lnbRecord.diseqcMsgs) {
991 diseqcMsgsIsValid &= diseqcMsgMap.find(msg) != diseqcMsgMap.end();
992 }
993
994 for (auto& msg : lnbLive.diseqcMsgs) {
995 diseqcMsgsIsValid &= diseqcMsgMap.find(msg) != diseqcMsgMap.end();
996 }
997
Frankie Lizcano523e5452022-07-27 22:21:16 +0000998 for (auto& msg : lnbDescrambling.diseqcMsgs) {
999 diseqcMsgsIsValid &= diseqcMsgMap.find(msg) != diseqcMsgMap.end();
1000 }
1001
Frankie Lizcano647d5aa2022-06-30 20:49:31 +00001002 if (!diseqcMsgsIsValid) {
1003 ALOGW("[vts config] dynamic config diseqcMsg is invalid.");
1004 return false;
1005 }
1006
Hongguang600a6ae2021-07-08 18:51:51 -07001007 return true;
1008}