summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2009-10-24 01:38:58 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2009-10-24 01:38:58 -0700
commit7ed70c9515fe3df6eb1796717d73f23e7286b3e6 (patch)
treeca15e2090451457b722bb524c5f2c75421477c9f /media
parentadddd24f31291f733cd5f72898b92f13f37ae37c (diff)
parentbf96aaadd46fb5b0884070177faa16ec4f22e2ba (diff)
downloadframeworks_base-7ed70c9515fe3df6eb1796717d73f23e7286b3e6.zip
frameworks_base-7ed70c9515fe3df6eb1796717d73f23e7286b3e6.tar.gz
frameworks_base-7ed70c9515fe3df6eb1796717d73f23e7286b3e6.tar.bz2
am bf96aaad: Merge change Icf10db28 into eclair
Merge commit 'bf96aaadd46fb5b0884070177faa16ec4f22e2ba' into eclair-mr2 * commit 'bf96aaadd46fb5b0884070177faa16ec4f22e2ba': Fix issue 2192181: AudioFlinger must provide separated methods to set VOICE_CALL stream volume and down link audio volume.
Diffstat (limited to 'media')
-rw-r--r--media/libmedia/AudioSystem.cpp7
-rw-r--r--media/libmedia/IAudioFlinger.cpp18
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);
}