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

Commit 575fdea5 authored by Eric Laurent's avatar Eric Laurent
Browse files

Revert "Revert "[audiopolicy][enginebase] Fix schema verification""

This reverts commit a98bfa5b.

Bug: 148588565
Test: playb music and check volume
Change-Id: I3a2b25552fcc59268a74d07416a6d706bd1d3d10
parent eeb2d61b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -141,6 +141,15 @@ engineConfig::ParsingResult EngineBase::loadAudioPolicyEngineConfig()
        result = {std::make_unique<engineConfig::Config>(config),
                  static_cast<size_t>(ret == NO_ERROR ? 0 : 1)};
    }
    // Append for internal use only strategies/volume groups (e.g. rerouting/patch)
    result.parsedConfig->productStrategies.insert(
                std::end(result.parsedConfig->productStrategies),
                std::begin(gOrderedSystemStrategies), std::end(gOrderedSystemStrategies));

    result.parsedConfig->volumeGroups.insert(
                std::end(result.parsedConfig->volumeGroups),
                std::begin(gSystemVolumeGroups), std::end(gSystemVolumeGroups));

    ALOGE_IF(result.nbSkippedElement != 0, "skipped %zu elements", result.nbSkippedElement);

    engineConfig::VolumeGroup defaultVolumeConfig;
+32 −3
Original line number Diff line number Diff line
@@ -125,15 +125,22 @@ const engineConfig::ProductStrategies gOrderedStrategies = {
            AUDIO_FLAG_BEACON, ""}}
         }
     },
    },
    {"STRATEGY_REROUTING",
    }
};

/**
 * For Internal use of respectively audio policy and audioflinger
 * For compatibility reason why apm volume config file, volume group name is the stream type.
 */
const engineConfig::ProductStrategies gOrderedSystemStrategies = {
    {"rerouting",
     {
         {"", AUDIO_STREAM_REROUTING, "AUDIO_STREAM_REROUTING",
          {{AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_UNKNOWN, AUDIO_SOURCE_DEFAULT, 0, ""}}
         }
     },
    },
    {"STRATEGY_PATCH",
    {"patch",
     {
         {"", AUDIO_STREAM_PATCH, "AUDIO_STREAM_PATCH",
          {{AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_UNKNOWN, AUDIO_SOURCE_DEFAULT, 0, ""}}
@@ -141,6 +148,28 @@ const engineConfig::ProductStrategies gOrderedStrategies = {
     },
    }
};
const engineConfig::VolumeGroups gSystemVolumeGroups = {
    {"AUDIO_STREAM_REROUTING", 0, 1,
     {
         {"DEVICE_CATEGORY_SPEAKER", {{0,0}, {100, 0}}},
         {"DEVICE_CATEGORY_HEADSET", {{0,0}, {100, 0}}},
         {"DEVICE_CATEGORY_EARPIECE", {{0,0}, {100, 0}}},
         {"DEVICE_CATEGORY_EXT_MEDIA", {{0,0}, {100, 0}}},
         {"DEVICE_CATEGORY_HEARING_AID", {{0,0}, {100, 0}}},

     }
    },
    {"AUDIO_STREAM_PATCH", 0, 1,
     {
         {"DEVICE_CATEGORY_SPEAKER", {{0,0}, {100, 0}}},
         {"DEVICE_CATEGORY_HEADSET", {{0,0}, {100, 0}}},
         {"DEVICE_CATEGORY_EARPIECE", {{0,0}, {100, 0}}},
         {"DEVICE_CATEGORY_EXT_MEDIA", {{0,0}, {100, 0}}},
         {"DEVICE_CATEGORY_HEARING_AID", {{0,0}, {100, 0}}},

     }
    }
};

const engineConfig::Config gDefaultEngineConfig = {
    1.0,
+0 −18
Original line number Diff line number Diff line
@@ -147,10 +147,6 @@ limitations under the License.
    <ProductStrategy name="notification">
        <AttributesGroup streamType="AUDIO_STREAM_NOTIFICATION" volumeGroup="ring">
            <Attributes> <Usage value="AUDIO_USAGE_NOTIFICATION"/> </Attributes>
            <Attributes> <Usage value="AUDIO_USAGE_NOTIFICATION_COMMUNICATION_INSTANT"/> </Attributes>
            <Attributes> <Usage value="AUDIO_USAGE_NOTIFICATION_COMMUNICATION_DELAYED"/> </Attributes>
            <Attributes> <Usage value="AUDIO_USAGE_NOTIFICATION_COMMUNICATION_REQUEST"/> </Attributes>
            <Attributes> <Usage value="AUDIO_USAGE_NOTIFICATION_EVENT"/> </Attributes>
        </AttributesGroup>
    </ProductStrategy>
    <ProductStrategy name="system">
@@ -167,19 +163,5 @@ limitations under the License.
        </AttributesGroup>
    </ProductStrategy>

    <!-- Routing Strategy rerouting may be removed as following media??? -->
    <ProductStrategy name="rerouting">
        <AttributesGroup streamType="AUDIO_STREAM_REROUTING" volumeGroup="rerouting">
            <Attributes></Attributes>
        </AttributesGroup>
    </ProductStrategy>

    <!-- Patch stream needs full scale volume, define it otherwise switch to default... -->
    <ProductStrategy name="patch">
        <AttributesGroup streamType="AUDIO_STREAM_PATCH" volumeGroup="patch">
            <Attributes></Attributes>
        </AttributesGroup>
    </ProductStrategy>

</ProductStrategies>
+0 −52
Original line number Diff line number Diff line
@@ -189,57 +189,5 @@
        </volume>
    </volumeGroup>

    <volumeGroup>
        <name>rerouting</name>
        <indexMin>0</indexMin>
        <indexMax>1</indexMax>
        <volume deviceCategory="DEVICE_CATEGORY_SPEAKER">
            <point>0,0</point>
            <point>100,0</point>
        </volume>
        <volume deviceCategory="DEVICE_CATEGORY_HEADSET">
            <point>0,0</point>
            <point>100,0</point>
        </volume>
        <volume deviceCategory="DEVICE_CATEGORY_EARPIECE">
            <point>0,0</point>
            <point>100,0</point>
        </volume>
        <volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA">
            <point>0,0</point>
            <point>100,0</point>
        </volume>
        <volume deviceCategory="DEVICE_CATEGORY_HEARING_AID">
            <point>0,0</point>
            <point>100,0</point>
        </volume>
    </volumeGroup>

    <volumeGroup>
        <name>patch</name>
        <indexMin>0</indexMin>
        <indexMax>1</indexMax>
        <volume deviceCategory="DEVICE_CATEGORY_SPEAKER">
            <point>0,0</point>
            <point>100,0</point>
        </volume>
        <volume deviceCategory="DEVICE_CATEGORY_HEADSET">
            <point>0,0</point>
            <point>100,0</point>
        </volume>
        <volume deviceCategory="DEVICE_CATEGORY_EARPIECE">
            <point>0,0</point>
            <point>100,0</point>
        </volume>
        <volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA">
            <point>0,0</point>
            <point>100,0</point>
        </volume>
        <volume deviceCategory="DEVICE_CATEGORY_HEARING_AID">
            <point>0,0</point>
            <point>100,0</point>
        </volume>
    </volumeGroup>

</volumeGroups>
+0 −17
Original line number Diff line number Diff line
@@ -147,10 +147,6 @@ limitations under the License.
    <ProductStrategy name="notification">
        <AttributesGroup streamType="AUDIO_STREAM_NOTIFICATION" volumeGroup="ring">
            <Attributes> <Usage value="AUDIO_USAGE_NOTIFICATION"/> </Attributes>
            <Attributes> <Usage value="AUDIO_USAGE_NOTIFICATION_COMMUNICATION_INSTANT"/> </Attributes>
            <Attributes> <Usage value="AUDIO_USAGE_NOTIFICATION_COMMUNICATION_DELAYED"/> </Attributes>
            <Attributes> <Usage value="AUDIO_USAGE_NOTIFICATION_COMMUNICATION_REQUEST"/> </Attributes>
            <Attributes> <Usage value="AUDIO_USAGE_NOTIFICATION_EVENT"/> </Attributes>
        </AttributesGroup>
    </ProductStrategy>
    <ProductStrategy name="system">
@@ -167,18 +163,5 @@ limitations under the License.
        </AttributesGroup>
    </ProductStrategy>

    <!-- Routing Strategy rerouting may be removed as following media??? -->
    <ProductStrategy name="rerouting">
        <AttributesGroup streamType="AUDIO_STREAM_REROUTING" volumeGroup="rerouting">
            <Attributes></Attributes>
        </AttributesGroup>
    </ProductStrategy>

    <!-- Patch stream needs full scale volume, define it otherwise switch to default... -->
    <ProductStrategy name="patch">
        <AttributesGroup streamType="AUDIO_STREAM_PATCH" volumeGroup="patch">
            <Attributes></Attributes>
        </AttributesGroup>
    </ProductStrategy>
</ProductStrategies>
Loading