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

Commit 02abb5b9 authored by Amy Zhang's avatar Amy Zhang Committed by Android (Google) Code Review
Browse files

Merge "Allow filter configurations to have NULL filterSettings" into sc-dev

parents 381a7116 ea05b4b8
Loading
Loading
Loading
Loading
+82 −89
Original line number Diff line number Diff line
@@ -3571,6 +3571,7 @@ static DemuxFilterSettings getFilterConfiguration(
                .tpid = tpid,
            };

            if (settingsObj != NULL) {
                DemuxTsFilterType tsType = static_cast<DemuxTsFilterType>(subtype);
                switch (tsType) {
                    case DemuxTsFilterType::SECTION:
@@ -3592,6 +3593,7 @@ static DemuxFilterSettings getFilterConfiguration(
                    default:
                        break;
                }
            }
            filterSettings.ts(tsFilterSettings);
            break;
        }
@@ -3602,6 +3604,8 @@ static DemuxFilterSettings getFilterConfiguration(
            DemuxMmtpFilterSettings mmtpFilterSettings {
                .mmtpPid = mmtpPid,
            };

            if (settingsObj != NULL) {
                DemuxMmtpFilterType mmtpType = static_cast<DemuxMmtpFilterType>(subtype);
                switch (mmtpType) {
                    case DemuxMmtpFilterType::SECTION:
@@ -3627,23 +3631,21 @@ static DemuxFilterSettings getFilterConfiguration(
                    default:
                        break;
                }
            }
            filterSettings.mmtp(mmtpFilterSettings);
            break;
        }
        case DemuxFilterMainType::IP: {
            DemuxIpAddress ipAddr = getDemuxIpAddress(env, filterConfigObj);

            DemuxIpFilterSettings ipFilterSettings {
                .ipAddr = ipAddr,
            };

            DemuxIpFilterType ipType = static_cast<DemuxIpFilterType>(subtype);
            switch (ipType) {
                case DemuxIpFilterType::SECTION: {
            if (ipType == DemuxIpFilterType::SECTION && settingsObj != NULL) {
                ipFilterSettings.filterSettings.section(
                                getFilterSectionSettings(env, settingsObj));
                    break;
                }
                case DemuxIpFilterType::IP: {
            } else if (ipType == DemuxIpFilterType::IP) {
                jclass clazz = env->FindClass(
                        "android/media/tv/tuner/filter/IpFilterConfiguration");
                bool bPassthrough = static_cast<bool>(
@@ -3651,11 +3653,6 @@ static DemuxFilterSettings getFilterConfiguration(
                                filterConfigObj, env->GetFieldID(
                                        clazz, "mPassthrough", "Z")));
                ipFilterSettings.filterSettings.bPassthrough(bPassthrough);
                    break;
                }
                default: {
                    break;
                }
            }
            filterSettings.ip(ipFilterSettings);
            break;
@@ -3672,24 +3669,17 @@ static DemuxFilterSettings getFilterConfiguration(
                .packetType = packetType,
                .isCompressedIpPacket = isCompressedIpPacket,
            };

            DemuxTlvFilterType tlvType = static_cast<DemuxTlvFilterType>(subtype);
            switch (tlvType) {
                case DemuxTlvFilterType::SECTION: {
            if (tlvType == DemuxTlvFilterType::SECTION && settingsObj != NULL) {
                tlvFilterSettings.filterSettings.section(
                        getFilterSectionSettings(env, settingsObj));
                    break;
                }
                case DemuxTlvFilterType::TLV: {
            } else if (tlvType == DemuxTlvFilterType::TLV) {
                bool bPassthrough = static_cast<bool>(
                env->GetBooleanField(
                        filterConfigObj, env->GetFieldID(
                                clazz, "mPassthrough", "Z")));
                tlvFilterSettings.filterSettings.bPassthrough(bPassthrough);
                    break;
                }
                default: {
                    break;
                }
            }
            filterSettings.tlv(tlvFilterSettings);
            break;
@@ -3704,6 +3694,8 @@ static DemuxFilterSettings getFilterConfiguration(
                .packetType = packetType,
                .lengthType = lengthType,
            };

            if (settingsObj != NULL) {
                DemuxAlpFilterType alpType = static_cast<DemuxAlpFilterType>(subtype);
                switch (alpType) {
                    case DemuxAlpFilterType::SECTION:
@@ -3713,6 +3705,7 @@ static DemuxFilterSettings getFilterConfiguration(
                    default:
                        break;
                }
            }
            filterSettings.alp(alpFilterSettings);
            break;
        }