From 25101b0b9a84571ead15b26e9f4cd9c4298d7823 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Wed, 2 Feb 2011 09:33:30 -0800 Subject: Fix issue 3371080 Modified default volume control logic in AudioService: 1 IN_CALL volume if in video/audio chat 2 NOTIFICATION if notification is playing or was playing less than 5s ago. 3 MUSIC Modified silent mode: - now also affect MUSIC stream type - entering silent mode when VOL- hard key is pressed once while selected stream volume is already at 0 (except for VOICE_CALL stream). - exiting silent mode when pressing VOL+ hard key while in silent mode Play sound FX (audible selections, keyboard clicks) at a fixed volume. Modified audio framework: - isStreamActive() method now implemented in AudioPolicyManagerBase (previously AudioFlinger) - iStreamActive() now specifies a time window during which the stream is considered active after it actually stopped. Change-Id: I7e5a0724099450b9fc90825224180ac97322785f --- media/libmedia/AudioSystem.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'media/libmedia/AudioSystem.cpp') diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp index 1a3fcd6c3870..9d9b3c08ac9d 100644 --- a/media/libmedia/AudioSystem.cpp +++ b/media/libmedia/AudioSystem.cpp @@ -169,15 +169,6 @@ status_t AudioSystem::setMode(int mode) return af->setMode(mode); } - -status_t AudioSystem::isStreamActive(int stream, bool* state) { - const sp& af = AudioSystem::get_audio_flinger(); - if (af == 0) return PERMISSION_DENIED; - *state = af->isStreamActive(stream); - return NO_ERROR; -} - - status_t AudioSystem::setParameters(audio_io_handle_t ioHandle, const String8& keyValuePairs) { const sp& af = AudioSystem::get_audio_flinger(); if (af == 0) return PERMISSION_DENIED; @@ -702,6 +693,14 @@ status_t AudioSystem::unregisterEffect(int id) return aps->unregisterEffect(id); } +status_t AudioSystem::isStreamActive(int stream, bool* state, uint32_t inPastMs) { + const sp& aps = AudioSystem::get_audio_policy_service(); + if (aps == 0) return PERMISSION_DENIED; + *state = aps->isStreamActive(stream, inPastMs); + return NO_ERROR; +} + + // --------------------------------------------------------------------------- void AudioSystem::AudioPolicyServiceClient::binderDied(const wp& who) { -- cgit v1.2.3-59-g8ed1b