diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-10-24 04:32:28 -0400 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-10-24 04:32:28 -0400 |
commit | 88e5ad9f0d9b35d4868347bce47b28b7358b32e4 (patch) | |
tree | ed98cd518a493ead689846309cbd513447aed7a7 /media/libmedia | |
parent | a9a4390989072d579eedab6b71fb41248b3ad8fe (diff) | |
parent | f0ee6f4055e26fb35d9c526a596668a4dc9da5ba (diff) | |
download | frameworks_av-88e5ad9f0d9b35d4868347bce47b28b7358b32e4.zip frameworks_av-88e5ad9f0d9b35d4868347bce47b28b7358b32e4.tar.gz frameworks_av-88e5ad9f0d9b35d4868347bce47b28b7358b32e4.tar.bz2 |
Merge change Icf10db28 into eclair
* changes:
Fix issue 2192181: AudioFlinger must provide separated methods to set VOICE_CALL stream volume and down link audio volume.
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/AudioSystem.cpp | 7 | ||||
-rw-r--r-- | media/libmedia/IAudioFlinger.cpp | 18 |
2 files changed, 24 insertions, 1 deletions
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp index bd1b2d7..5352234 100644 --- a/media/libmedia/AudioSystem.cpp +++ b/media/libmedia/AudioSystem.cpp @@ -335,6 +335,13 @@ status_t AudioSystem::getInputBufferSize(uint32_t sampleRate, int format, int ch return NO_ERROR; } +status_t AudioSystem::setVoiceVolume(float value) +{ + const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger(); + if (af == 0) return PERMISSION_DENIED; + return af->setVoiceVolume(value); +} + // --------------------------------------------------------------------------- void AudioSystem::AudioFlingerClient::binderDied(const wp<IBinder>& who) { diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp index 5089157..0eff205 100644 --- a/media/libmedia/IAudioFlinger.cpp +++ b/media/libmedia/IAudioFlinger.cpp @@ -59,7 +59,8 @@ enum { RESTORE_OUTPUT, OPEN_INPUT, CLOSE_INPUT, - SET_STREAM_OUTPUT + SET_STREAM_OUTPUT, + SET_VOICE_VOLUME }; class BpAudioFlinger : public BpInterface<IAudioFlinger> @@ -455,6 +456,15 @@ public: remote()->transact(SET_STREAM_OUTPUT, data, &reply); return reply.readInt32(); } + + virtual status_t setVoiceVolume(float volume) + { + Parcel data, reply; + data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor()); + data.writeFloat(volume); + remote()->transact(SET_VOICE_VOLUME, data, &reply); + return reply.readInt32(); + } }; IMPLEMENT_META_INTERFACE(AudioFlinger, "android.media.IAudioFlinger"); @@ -700,6 +710,12 @@ status_t BnAudioFlinger::onTransact( reply->writeInt32(setStreamOutput(stream, output)); return NO_ERROR; } break; + case SET_VOICE_VOLUME: { + CHECK_INTERFACE(IAudioFlinger, data, reply); + float volume = data.readFloat(); + reply->writeInt32( setVoiceVolume(volume) ); + return NO_ERROR; + } break; default: return BBinder::onTransact(code, data, reply, flags); } |