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

Commit 575bb3aa authored by Kevin Rocard's avatar Kevin Rocard
Browse files

Config deserialization: allow negative gain



Audio policy configuration deserializer did not support negative gains
in audio profiles.

As those gains are most always attenuation (negative) this mean that
profile can not currently contain gains.

Test: policy sysdump show negative gain
Test: play music and assistant work on speaker, skylab
Bug: 68229318
Change-Id: I7d72a0dd464aa77847d7e3ec0cfb4dcf7ac25b24
Signed-off-by: default avatarKevin Rocard <krocard@google.com>
parent 6086cd30
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -140,19 +140,19 @@ status_t AudioGainTraits::deserialize(_xmlDoc */*doc*/, const _xmlNode *root, Pt
    }

    string minValueMBLiteral = getXmlAttribute(root, Attributes::minValueMB);
    uint32_t minValueMB;
    int32_t minValueMB;
    if (!minValueMBLiteral.empty() && convertTo(minValueMBLiteral, minValueMB)) {
        gain->setMinValueInMb(minValueMB);
    }

    string maxValueMBLiteral = getXmlAttribute(root, Attributes::maxValueMB);
    uint32_t maxValueMB;
    int32_t maxValueMB;
    if (!maxValueMBLiteral.empty() && convertTo(maxValueMBLiteral, maxValueMB)) {
        gain->setMaxValueInMb(maxValueMB);
    }

    string defaultValueMBLiteral = getXmlAttribute(root, Attributes::defaultValueMB);
    uint32_t defaultValueMB;
    int32_t defaultValueMB;
    if (!defaultValueMBLiteral.empty() && convertTo(defaultValueMBLiteral, defaultValueMB)) {
        gain->setDefaultValueInMb(defaultValueMB);
    }