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

Commit fee832a0 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

Dynamic audio policies: fix AttributeMatchCriterion addition in mix

When adding an AttributeMatchCriterion for a mix, build the instance
  with the constructor that matches the rule.

Bug 26798796

Change-Id: I130f4bdab51644685413d294096d35d9685ea5eb
parent fba5a3b6
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -428,8 +428,17 @@ public class AudioMixingRule {
                    }
                }
                // rule didn't exist, add it
                // FIXME doesn't work with RULE_MATCH_UID yet
                switch (match_rule) {
                    case RULE_MATCH_ATTRIBUTE_USAGE:
                    case RULE_MATCH_ATTRIBUTE_CAPTURE_PRESET:
                        mCriteria.add(new AttributeMatchCriterion(attrToMatch, rule));
                        break;
                    case RULE_MATCH_UID:
                        mCriteria.add(new AttributeMatchCriterion(intProp, rule));
                        break;
                    default:
                        throw new IllegalStateException("Unreachable code in addRuleInternal()");
                }
            }
            return this;
        }