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

Commit bb1c6dcd authored by Amy Zhang's avatar Amy Zhang Committed by Automerger Merge Worker
Browse files

Merge "Allow filter configurations to have NULL filterSettings" into sc-dev am: 02abb5b9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13693789

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib0b0ce3d0b3bce38657f364b3472e80405135cc7
parents 9130ed5f 02abb5b9
Loading
Loading
Loading
Loading
+82 −89
Original line number Original line Diff line number Diff line
@@ -3571,6 +3571,7 @@ static DemuxFilterSettings getFilterConfiguration(
                .tpid = tpid,
                .tpid = tpid,
            };
            };


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

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

            DemuxIpFilterSettings ipFilterSettings {
            DemuxIpFilterSettings ipFilterSettings {
                .ipAddr = ipAddr,
                .ipAddr = ipAddr,
            };
            };

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

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

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