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

Commit 4c2948bc authored by François Gaffie's avatar François Gaffie Committed by Mikhail Naganov
Browse files

audiopolicy: capengine: fix missing comma when chaining compound rules



When chaining compound rule closed by "}", a comma is added to notify the continuation. This comma was missing, hence breaking rule parsing.

Bug: 388404113
Test: m

Change-Id: I3f90c5e91263a4ad1a78a91ea8c667f2e51b7d9b
Signed-off-by: default avatarFrançois Gaffie <francois.gaffie@ampere.cars>
parent aaafa175
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -316,13 +316,14 @@ ConversionResult<std::string> aidl2legacy_AudioHalCapRule_CapRule(
    }
    rule += "{";
    if (!aidlRule.nestedRules.empty()) {
        for (const auto& nestedRule: aidlRule.nestedRules) {
            rule += VALUE_OR_FATAL(aidl2legacy_AudioHalCapRule_CapRule(nestedRule));
        }
        if (!aidlRule.criterionRules.empty()) {
        for (auto ruleIter = aidlRule.nestedRules.begin(); ruleIter != aidlRule.nestedRules.end();
                ++ruleIter) {
            rule += VALUE_OR_FATAL(aidl2legacy_AudioHalCapRule_CapRule(*ruleIter));
            if (ruleIter != (aidlRule.nestedRules.end()  - 1) || !aidlRule.criterionRules.empty()) {
                rule += ",";
            }
        }
    }
    bool isFirstCriterionRule = true;
    for (const auto& criterionRule: aidlRule.criterionRules) {
        if (!isFirstCriterionRule) {