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

Commit f2354c67 authored by Amy Zhang's avatar Amy Zhang
Browse files

Add more status capabilities in Tuner default implementation

This CL added more extended frontend status caps into the
default implementation to test more code paths.

Note that this CL changes the 0 fe from dvbt to isdbs to cover more
status caps. fe 0 is used as the default testing fe in CTS

Test: atest android.media.tv.tuner.cts
Bug: 159067322
Change-Id: I7c15f5fe3cd133af4a191b80ce832a9affef9ee3
parent 360a6fcf
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -196,7 +196,7 @@ Return<void> Frontend::getStatus(const hidl_vec<FrontendStatusType>& statusTypes
            }
            case FrontendStatusType::MODULATION: {
                FrontendModulationStatus modulationStatus;
                modulationStatus.isdbt(FrontendIsdbtModulation::MOD_16QAM);  // value = 1 << 3
                modulationStatus.isdbs(FrontendIsdbsModulation::MOD_BPSK);  // value = 1 << 1
                status.modulation(modulationStatus);
                break;
            }
@@ -281,12 +281,14 @@ Return<void> Frontend::getStatusExt1_1(const hidl_vec<V1_1::FrontendStatusTypeEx
    for (int i = 0; i < statusTypes.size(); i++) {
        V1_1::FrontendStatusTypeExt1_1 type = statusTypes[i];
        V1_1::FrontendStatusExt1_1 status;

        // assign randomly selected values for testing.
        // TODO: assign status values according to the frontend type
        switch (type) {
            case V1_1::FrontendStatusTypeExt1_1::MODULATIONS: {
                vector<V1_1::FrontendModulation> modulations;
                V1_1::FrontendModulation modulation;
                modulation.isdbt(FrontendIsdbtModulation::MOD_16QAM);  // value = 1 << 3
                modulation.isdbs(FrontendIsdbsModulation::MOD_BPSK);  // value = 1 << 1
                modulations.push_back(modulation);
                status.modulations(modulations);
                break;
@@ -347,7 +349,7 @@ Return<void> Frontend::getStatusExt1_1(const hidl_vec<V1_1::FrontendStatusTypeEx
            }
            case V1_1::FrontendStatusTypeExt1_1::ROLL_OFF: {
                V1_1::FrontendRollOff rollOff;
                rollOff.dvbs(FrontendDvbsRolloff::ROLLOFF_0_35);
                rollOff.isdbs(FrontendIsdbsRolloff::ROLLOFF_0_35);
                status.rollOff(rollOff);
                break;
            }
+4 −2
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ Tuner::Tuner() {
    // Static Frontends array to maintain local frontends information
    // Array index matches their FrontendId in the default impl
    mFrontendSize = 9;
    mFrontends[0] = new Frontend(FrontendType::DVBT, 0, this);
    mFrontends[0] = new Frontend(FrontendType::ISDBS, 0, this);
    mFrontends[1] = new Frontend(FrontendType::ATSC, 1, this);
    mFrontends[2] = new Frontend(FrontendType::DVBC, 2, this);
    mFrontends[3] = new Frontend(FrontendType::DVBS, 3, this);
@@ -47,7 +47,7 @@ Tuner::Tuner() {

    FrontendInfo::FrontendCapabilities caps;
    caps = FrontendInfo::FrontendCapabilities();
    caps.dvbtCaps(FrontendDvbtCapabilities());
    caps.isdbsCaps(FrontendIsdbsCapabilities());
    mFrontendCaps[0] = caps;

    caps = FrontendInfo::FrontendCapabilities();
@@ -168,6 +168,8 @@ Return<void> Tuner::getFrontendInfo(FrontendId frontendId, getFrontendInfo_cb _h
            FrontendStatusType::PLP_ID,
            FrontendStatusType::LAYER_ERROR,
            FrontendStatusType::ATSC3_PLP_INFO,
            static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::MODULATIONS),
            static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::ROLL_OFF),
    };
    // assign randomly selected values for testing.
    info = {