diff options
author | Eric Laurent <elaurent@google.com> | 2013-03-25 09:58:09 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2013-03-25 16:58:39 -0700 |
commit | 80f5b0400f86d49e70aa1a793b34f34492f005bc (patch) | |
tree | 8c7a488658c600ea914b3b5da8f1227d206b28f8 /include/hardware_legacy/AudioPolicyManagerBase.h | |
parent | 58d6b9eb20a9805ea7cecff1df01259e8a2ce1d4 (diff) | |
download | hardware_libhardware_legacy-80f5b0400f86d49e70aa1a793b34f34492f005bc.zip hardware_libhardware_legacy-80f5b0400f86d49e70aa1a793b34f34492f005bc.tar.gz hardware_libhardware_legacy-80f5b0400f86d49e70aa1a793b34f34492f005bc.tar.bz2 |
audio policy: fix music glitch when starting call
When answering a call in silent mode, music playing over A2DP
was not immediately muted by current audio policy manager logic.
The fix consists in muting media strategy on all output streams
immediately when entering in call.
Also add methods to AudioOutputDescriptor to report
recent global, per strategy and per stream activity.
Bug 8315512
Change-Id: I4a90eb05db50e4f22374d02b1e647e8662f6bec6
Diffstat (limited to 'include/hardware_legacy/AudioPolicyManagerBase.h')
-rw-r--r-- | include/hardware_legacy/AudioPolicyManagerBase.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/hardware_legacy/AudioPolicyManagerBase.h b/include/hardware_legacy/AudioPolicyManagerBase.h index 98594d6..c5a917c 100644 --- a/include/hardware_legacy/AudioPolicyManagerBase.h +++ b/include/hardware_legacy/AudioPolicyManagerBase.h @@ -246,15 +246,18 @@ protected: status_t dump(int fd); audio_devices_t device() const; - void changeRefCount(AudioSystem::stream_type, int delta); - uint32_t refCount(); - uint32_t strategyRefCount(routing_strategy strategy); - bool isUsedByStrategy(routing_strategy strategy) { return (strategyRefCount(strategy) != 0);} + void changeRefCount(AudioSystem::stream_type stream, int delta); bool isDuplicated() const { return (mOutput1 != NULL && mOutput2 != NULL); } audio_devices_t supportedDevices(); uint32_t latency(); bool sharesHwModuleWith(const AudioOutputDescriptor *outputDesc); - bool isActive(uint32_t inPastMs) const; + bool isActive(uint32_t inPastMs = 0) const; + bool isStreamActive(AudioSystem::stream_type stream, + uint32_t inPastMs = 0, + nsecs_t sysTime = 0) const; + bool isStrategyActive(routing_strategy strategy, + uint32_t inPastMs = 0, + nsecs_t sysTime = 0) const; audio_io_handle_t mId; // output handle uint32_t mSamplingRate; // |