Loading services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -33,7 +33,10 @@ namespace android { DeviceTypeSet APM_AUDIO_OUT_DEVICE_REMOTE_ALL = {AUDIO_DEVICE_OUT_REMOTE_SUBMIX}; static const DeviceTypeSet& getAllOutRemoteDevices() { static const DeviceTypeSet allOutRemoteDevices = {AUDIO_DEVICE_OUT_REMOTE_SUBMIX}; return allOutRemoteDevices; } AudioOutputDescriptor::AudioOutputDescriptor(const sp<PolicyAudioPort>& policyAudioPort, AudioPolicyClientInterface *clientInterface) Loading Loading @@ -681,7 +684,7 @@ bool SwAudioOutputCollection::isActiveLocally(VolumeSource volumeSource, uint32_ const sp<SwAudioOutputDescriptor> outputDesc = this->valueAt(i); if (outputDesc->isActive(volumeSource, inPastMs, sysTime) && (!(outputDesc->devices() .containsDeviceAmongTypes(APM_AUDIO_OUT_DEVICE_REMOTE_ALL)))) { .containsDeviceAmongTypes(getAllOutRemoteDevices())))) { return true; } } Loading @@ -693,7 +696,7 @@ bool SwAudioOutputCollection::isActiveRemotely(VolumeSource volumeSource, uint32 nsecs_t sysTime = systemTime(); for (size_t i = 0; i < size(); i++) { const sp<SwAudioOutputDescriptor> outputDesc = valueAt(i); if (outputDesc->devices().containsDeviceAmongTypes(APM_AUDIO_OUT_DEVICE_REMOTE_ALL) && if (outputDesc->devices().containsDeviceAmongTypes(getAllOutRemoteDevices()) && outputDesc->isActive(volumeSource, inPastMs, sysTime)) { // do not consider re routing (when the output is going to a dynamic policy) // as "remote playback" Loading services/audiopolicy/enginedefault/src/Engine.cpp +17 −13 Original line number Diff line number Diff line Loading @@ -41,7 +41,8 @@ namespace audio_policy { struct legacy_strategy_map { const char *name; legacy_strategy id; }; static const std::vector<legacy_strategy_map> gLegacyStrategy = { static const std::vector<legacy_strategy_map>& getLegacyStrategy() { static const std::vector<legacy_strategy_map> legacyStrategy = { { "STRATEGY_NONE", STRATEGY_NONE }, { "STRATEGY_MEDIA", STRATEGY_MEDIA }, { "STRATEGY_PHONE", STRATEGY_PHONE }, Loading @@ -54,6 +55,8 @@ static const std::vector<legacy_strategy_map> gLegacyStrategy = { { "STRATEGY_REROUTING", STRATEGY_REROUTING }, { "STRATEGY_PATCH", STRATEGY_REROUTING }, // boiler to manage stream patch volume }; return legacyStrategy; }; Engine::Engine() { Loading @@ -62,7 +65,8 @@ Engine::Engine() "Policy Engine configuration is partially invalid, skipped %zu elements", result.nbSkippedElement); for (const auto &strategy : gLegacyStrategy) { auto legacyStrategy = getLegacyStrategy(); for (const auto &strategy : legacyStrategy) { mLegacyStrategyMap[getProductStrategyByName(strategy.name)] = strategy.id; } } Loading Loading
services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -33,7 +33,10 @@ namespace android { DeviceTypeSet APM_AUDIO_OUT_DEVICE_REMOTE_ALL = {AUDIO_DEVICE_OUT_REMOTE_SUBMIX}; static const DeviceTypeSet& getAllOutRemoteDevices() { static const DeviceTypeSet allOutRemoteDevices = {AUDIO_DEVICE_OUT_REMOTE_SUBMIX}; return allOutRemoteDevices; } AudioOutputDescriptor::AudioOutputDescriptor(const sp<PolicyAudioPort>& policyAudioPort, AudioPolicyClientInterface *clientInterface) Loading Loading @@ -681,7 +684,7 @@ bool SwAudioOutputCollection::isActiveLocally(VolumeSource volumeSource, uint32_ const sp<SwAudioOutputDescriptor> outputDesc = this->valueAt(i); if (outputDesc->isActive(volumeSource, inPastMs, sysTime) && (!(outputDesc->devices() .containsDeviceAmongTypes(APM_AUDIO_OUT_DEVICE_REMOTE_ALL)))) { .containsDeviceAmongTypes(getAllOutRemoteDevices())))) { return true; } } Loading @@ -693,7 +696,7 @@ bool SwAudioOutputCollection::isActiveRemotely(VolumeSource volumeSource, uint32 nsecs_t sysTime = systemTime(); for (size_t i = 0; i < size(); i++) { const sp<SwAudioOutputDescriptor> outputDesc = valueAt(i); if (outputDesc->devices().containsDeviceAmongTypes(APM_AUDIO_OUT_DEVICE_REMOTE_ALL) && if (outputDesc->devices().containsDeviceAmongTypes(getAllOutRemoteDevices()) && outputDesc->isActive(volumeSource, inPastMs, sysTime)) { // do not consider re routing (when the output is going to a dynamic policy) // as "remote playback" Loading
services/audiopolicy/enginedefault/src/Engine.cpp +17 −13 Original line number Diff line number Diff line Loading @@ -41,7 +41,8 @@ namespace audio_policy { struct legacy_strategy_map { const char *name; legacy_strategy id; }; static const std::vector<legacy_strategy_map> gLegacyStrategy = { static const std::vector<legacy_strategy_map>& getLegacyStrategy() { static const std::vector<legacy_strategy_map> legacyStrategy = { { "STRATEGY_NONE", STRATEGY_NONE }, { "STRATEGY_MEDIA", STRATEGY_MEDIA }, { "STRATEGY_PHONE", STRATEGY_PHONE }, Loading @@ -54,6 +55,8 @@ static const std::vector<legacy_strategy_map> gLegacyStrategy = { { "STRATEGY_REROUTING", STRATEGY_REROUTING }, { "STRATEGY_PATCH", STRATEGY_REROUTING }, // boiler to manage stream patch volume }; return legacyStrategy; }; Engine::Engine() { Loading @@ -62,7 +65,8 @@ Engine::Engine() "Policy Engine configuration is partially invalid, skipped %zu elements", result.nbSkippedElement); for (const auto &strategy : gLegacyStrategy) { auto legacyStrategy = getLegacyStrategy(); for (const auto &strategy : legacyStrategy) { mLegacyStrategyMap[getProductStrategyByName(strategy.name)] = strategy.id; } } Loading