Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 647d5aa8 authored by Frankie Lizcano's avatar Frankie Lizcano
Browse files

Improve Tuner VTS Configuration: Enable Lnb, LnbRecord, and

LnbLive configuration

This CL allows vendors to configure Lnb's in their configuration
files. Also, support for the LnbRecord and LnbLive data flows was
implemented. Their connections were checked to ensure their validity.
Additionally, the option to configure extra filters for each was added.

Bug: b/182519645

Test: vts-tradefed run vts --module VtsHalTvTunerTargetTest
Change-Id: I4f733091beb70e7f5658fb5572064f4628bbbfc3
parent f535212b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@ bool initConfiguration() {
    initDvrConfig();
    initTimeFilterConfig();
    initDescramblerConfig();
    initLnbConfig();
    initDiseqcMsgsConfig();
    connectHardwaresToTestCases();
    if (!validateConnections()) {
        ALOGW("[vts] failed to validate connections.");
+59 −0
Original line number Diff line number Diff line
@@ -172,6 +172,16 @@ inline void initDescramblerConfig() {
    TunerTestingConfigAidlReader1_0::readDescramblerConfig1_0(descramblerMap);
}

inline void initLnbConfig() {
    // Read customized config
    TunerTestingConfigAidlReader1_0::readLnbConfig1_0(lnbMap);
};

inline void initDiseqcMsgsConfig() {
    // Read customized config
    TunerTestingConfigAidlReader1_0::readDiseqcMessages(diseqcMsgMap);
};

/** Read the vendor configurations of which hardware to use for each test cases/data flows */
inline void connectHardwaresToTestCases() {
    TunerTestingConfigAidlReader1_0::connectLiveBroadcast(live);
@@ -179,6 +189,8 @@ inline void connectHardwaresToTestCases() {
    TunerTestingConfigAidlReader1_0::connectDvrRecord(record);
    TunerTestingConfigAidlReader1_0::connectTimeFilter(timeFilter);
    TunerTestingConfigAidlReader1_0::connectDescrambling(descrambling);
    TunerTestingConfigAidlReader1_0::connectLnbLive(lnbLive);
    TunerTestingConfigAidlReader1_0::connectLnbRecord(lnbRecord);
};

inline bool validateConnections() {
@@ -199,6 +211,11 @@ inline bool validateConnections() {
                         ? frontendMap.find(descrambling.frontendId) != frontendMap.end()
                         : true;

    feIsValid &= lnbLive.support ? frontendMap.find(lnbLive.frontendId) != frontendMap.end() : true;

    feIsValid &=
            lnbRecord.support ? frontendMap.find(lnbRecord.frontendId) != frontendMap.end() : true;

    if (!feIsValid) {
        ALOGW("[vts config] dynamic config fe connection is invalid.");
        return false;
@@ -229,6 +246,8 @@ inline bool validateConnections() {
        }
    }

    dvrIsValid &= lnbRecord.support ? dvrMap.find(lnbRecord.dvrRecordId) != dvrMap.end() : true;

    if (!dvrIsValid) {
        ALOGW("[vts config] dynamic config dvr connection is invalid.");
        return false;
@@ -250,6 +269,22 @@ inline bool validateConnections() {
        filterIsValid &= filterMap.find(filterId) != filterMap.end();
    }

    filterIsValid &= lnbLive.support
                             ? filterMap.find(lnbLive.audioFilterId) != filterMap.end() &&
                                       filterMap.find(lnbLive.videoFilterId) != filterMap.end()
                             : true;

    filterIsValid &=
            lnbRecord.support ? filterMap.find(lnbRecord.recordFilterId) != filterMap.end() : true;

    for (auto& filterId : lnbRecord.extraFilters) {
        filterIsValid &= filterMap.find(filterId) != filterMap.end();
    }

    for (auto& filterId : lnbLive.extraFilters) {
        filterIsValid &= filterMap.find(filterId) != filterMap.end();
    }

    if (!filterIsValid) {
        ALOGW("[vts config] dynamic config filter connection is invalid.");
        return false;
@@ -273,5 +308,29 @@ inline bool validateConnections() {
        return false;
    }

    bool lnbIsValid = lnbLive.support ? lnbMap.find(lnbLive.lnbId) != lnbMap.end() : true;

    lnbIsValid &= lnbRecord.support ? lnbMap.find(lnbRecord.lnbId) != lnbMap.end() : true;

    if (!lnbIsValid) {
        ALOGW("[vts config] dynamic config lnb connection is invalid.");
        return false;
    }

    bool diseqcMsgsIsValid = true;

    for (auto& msg : lnbRecord.diseqcMsgs) {
        diseqcMsgsIsValid &= diseqcMsgMap.find(msg) != diseqcMsgMap.end();
    }

    for (auto& msg : lnbLive.diseqcMsgs) {
        diseqcMsgsIsValid &= diseqcMsgMap.find(msg) != diseqcMsgMap.end();
    }

    if (!diseqcMsgsIsValid) {
        ALOGW("[vts config] dynamic config diseqcMsg is invalid.");
        return false;
    }

    return true;
}
+10 −2
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ struct LnbLiveHardwareConnections {
    string videoFilterId;
    string lnbId;
    vector<string> diseqcMsgs;
    /* list string of extra filters; */
    vector<string> extraFilters;
};

struct LnbRecordHardwareConnections {
@@ -193,7 +193,7 @@ struct LnbRecordHardwareConnections {
    string recordFilterId;
    string lnbId;
    vector<string> diseqcMsgs;
    /* list string of extra filters; */
    vector<string> extraFilters;
};

struct TimeFilterHardwareConnections {
@@ -606,6 +606,10 @@ struct TunerTestingConfigAidlReader1_0 {
                lnbLive.diseqcMsgs.push_back(msgName);
            }
        }
        if (lnbLiveConfig.hasOptionalFilters()) {
            auto optionalFilters = lnbLiveConfig.getOptionalFilters();
            lnbLive.extraFilters = optionalFilters;
        }
    }

    static void connectLnbRecord(LnbRecordHardwareConnections& lnbRecord) {
@@ -626,6 +630,10 @@ struct TunerTestingConfigAidlReader1_0 {
                lnbRecord.diseqcMsgs.push_back(msgName);
            }
        }
        if (lnbRecordConfig.hasOptionalFilters()) {
            auto optionalFilters = lnbRecordConfig.getOptionalFilters();
            lnbRecord.extraFilters = optionalFilters;
        }
    }

    static void connectTimeFilter(TimeFilterHardwareConnections& timeFilter) {
+4 −0
Original line number Diff line number Diff line
@@ -113,11 +113,13 @@ package android.media.tuner.testing.configuration.V1_0 {
    method @Nullable public java.util.List<java.lang.String> getDiseqcMsgSender();
    method @Nullable public String getFrontendConnection();
    method @Nullable public String getLnbConnection();
    method @Nullable public java.util.List<java.lang.String> getOptionalFilters();
    method @Nullable public String getVideoFilterConnection();
    method public void setAudioFilterConnection(@Nullable String);
    method public void setDiseqcMsgSender(@Nullable java.util.List<java.lang.String>);
    method public void setFrontendConnection(@Nullable String);
    method public void setLnbConnection(@Nullable String);
    method public void setOptionalFilters(@Nullable java.util.List<java.lang.String>);
    method public void setVideoFilterConnection(@Nullable String);
  }

@@ -127,11 +129,13 @@ package android.media.tuner.testing.configuration.V1_0 {
    method @Nullable public String getDvrRecordConnection();
    method @Nullable public String getFrontendConnection();
    method @Nullable public String getLnbConnection();
    method @Nullable public java.util.List<java.lang.String> getOptionalFilters();
    method @Nullable public String getRecordFilterConnection();
    method public void setDiseqcMsgSender(@Nullable java.util.List<java.lang.String>);
    method public void setDvrRecordConnection(@Nullable String);
    method public void setFrontendConnection(@Nullable String);
    method public void setLnbConnection(@Nullable String);
    method public void setOptionalFilters(@Nullable java.util.List<java.lang.String>);
    method public void setRecordFilterConnection(@Nullable String);
  }

+2 −1
Original line number Diff line number Diff line
@@ -688,7 +688,7 @@
                    <xs:attribute name="videoFilterConnection" type="filterId" use="required"/>
                    <xs:attribute name="lnbConnection" type="lnbId" use="required"/>
                    <xs:attribute name="diseqcMsgSender" type="diseqcMsgSender" use="optional"/>
                    <!-- TODO: b/182519645 allow the users to insert extra filters -->
                    <xs:element name="optionalFilters" type="filterConnections" minOccurs="0" maxOccurs="1"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="lnbRecord" minOccurs="0" maxOccurs="1">
@@ -698,6 +698,7 @@
                    <xs:attribute name="dvrRecordConnection" type="dvrId" use="required"/>
                    <xs:attribute name="lnbConnection" type="lnbId" use="required"/>
                    <xs:attribute name="diseqcMsgSender" type="diseqcMsgSender" use="optional"/>
                    <xs:element name="optionalFilters" type="filterConnections" minOccurs="0" maxOccurs="1"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="timeFilter" minOccurs="0" maxOccurs="1">