Loading services/audiopolicy/AudioPolicyManager.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -921,7 +921,6 @@ status_t AudioPolicyManager::getOutputForAttr(const audio_attributes_t *attr, ALOGV("getOutputForAttr() usage=%d, content=%d, tag=%s flags=%08x", attributes.usage, attributes.content_type, attributes.tags, attributes.flags); // TODO this is where filtering for custom policies (rerouting, dynamic sources) will go routing_strategy strategy = (routing_strategy) getStrategyForAttr(&attributes); audio_devices_t device = getDeviceForStrategy(strategy, false /*fromCache*/); Loading Loading @@ -1962,9 +1961,14 @@ bool AudioPolicyManager::isStreamActiveRemotely(audio_stream_type_t stream, const sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(i); if (((outputDesc->device() & APM_AUDIO_OUT_DEVICE_REMOTE_ALL) != 0) && outputDesc->isStreamActive(stream, inPastMs, sysTime)) { // only consider empty or "0" address to only qualify the screen mirroring case // as "remote playback" (vs rerouting when the output is going to a dynamic policy) if (outputDesc->mPolicyMixAddress == String8("") || outputDesc->mPolicyMixAddress == String8("0")) { return true; } } } return false; } Loading services/audiopolicy/AudioPolicyManager.h +2 −0 Original line number Diff line number Diff line Loading @@ -155,6 +155,8 @@ public: // return whether a stream is playing remotely, override to change the definition of // local/remote playback, used for instance by notification manager to not make // media players lose audio focus when not playing locally // For the base implementation, "remotely" means playing during screen mirroring which // uses an output for playback with a non-empty, non "0" address. virtual bool isStreamActiveRemotely(audio_stream_type_t stream, uint32_t inPastMs = 0) const; virtual bool isSourceActive(audio_source_t source) const; Loading Loading
services/audiopolicy/AudioPolicyManager.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -921,7 +921,6 @@ status_t AudioPolicyManager::getOutputForAttr(const audio_attributes_t *attr, ALOGV("getOutputForAttr() usage=%d, content=%d, tag=%s flags=%08x", attributes.usage, attributes.content_type, attributes.tags, attributes.flags); // TODO this is where filtering for custom policies (rerouting, dynamic sources) will go routing_strategy strategy = (routing_strategy) getStrategyForAttr(&attributes); audio_devices_t device = getDeviceForStrategy(strategy, false /*fromCache*/); Loading Loading @@ -1962,9 +1961,14 @@ bool AudioPolicyManager::isStreamActiveRemotely(audio_stream_type_t stream, const sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(i); if (((outputDesc->device() & APM_AUDIO_OUT_DEVICE_REMOTE_ALL) != 0) && outputDesc->isStreamActive(stream, inPastMs, sysTime)) { // only consider empty or "0" address to only qualify the screen mirroring case // as "remote playback" (vs rerouting when the output is going to a dynamic policy) if (outputDesc->mPolicyMixAddress == String8("") || outputDesc->mPolicyMixAddress == String8("0")) { return true; } } } return false; } Loading
services/audiopolicy/AudioPolicyManager.h +2 −0 Original line number Diff line number Diff line Loading @@ -155,6 +155,8 @@ public: // return whether a stream is playing remotely, override to change the definition of // local/remote playback, used for instance by notification manager to not make // media players lose audio focus when not playing locally // For the base implementation, "remotely" means playing during screen mirroring which // uses an output for playback with a non-empty, non "0" address. virtual bool isStreamActiveRemotely(audio_stream_type_t stream, uint32_t inPastMs = 0) const; virtual bool isSourceActive(audio_source_t source) const; Loading