Loading services/audiopolicy/engine/common/src/EngineBase.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -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; Loading services/audiopolicy/engine/common/src/EngineDefaultConfig.h +32 −3 Original line number Diff line number Diff line Loading @@ -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, ""}} Loading @@ -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, Loading services/audiopolicy/engineconfigurable/config/example/automotive/audio_policy_engine_product_strategies.xml +0 −18 Original line number Diff line number Diff line Loading @@ -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"> Loading @@ -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> services/audiopolicy/engineconfigurable/config/example/automotive/audio_policy_engine_volumes.xml +0 −52 Original line number Diff line number Diff line Loading @@ -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> services/audiopolicy/engineconfigurable/config/example/caremu/audio_policy_engine_product_strategies.xml +0 −17 Original line number Diff line number Diff line Loading @@ -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"> Loading @@ -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
services/audiopolicy/engine/common/src/EngineBase.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -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; Loading
services/audiopolicy/engine/common/src/EngineDefaultConfig.h +32 −3 Original line number Diff line number Diff line Loading @@ -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, ""}} Loading @@ -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, Loading
services/audiopolicy/engineconfigurable/config/example/automotive/audio_policy_engine_product_strategies.xml +0 −18 Original line number Diff line number Diff line Loading @@ -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"> Loading @@ -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>
services/audiopolicy/engineconfigurable/config/example/automotive/audio_policy_engine_volumes.xml +0 −52 Original line number Diff line number Diff line Loading @@ -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>
services/audiopolicy/engineconfigurable/config/example/caremu/audio_policy_engine_product_strategies.xml +0 −17 Original line number Diff line number Diff line Loading @@ -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"> Loading @@ -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>