summaryrefslogtreecommitdiffstats
path: root/libaudio
diff options
context:
space:
mode:
authorUK KIM <w0806.kim@samsung.com>2011-03-05 09:19:45 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-03-05 09:19:45 -0800
commit68fcc9088fdcc365d7d7972660db06556f5e8321 (patch)
treea79ff6b76bfbae87198e099662a4145487316475 /libaudio
parent5b4d61eb09c5dd3da04d7f5e882d1bc1af65a315 (diff)
parente8106736688d60b730873969dba4b60a64cae5e3 (diff)
downloaddevice_samsung_crespo-68fcc9088fdcc365d7d7972660db06556f5e8321.zip
device_samsung_crespo-68fcc9088fdcc365d7d7972660db06556f5e8321.tar.gz
device_samsung_crespo-68fcc9088fdcc365d7d7972660db06556f5e8321.tar.bz2
am e8106736: am d7657374: SOUND: set incall volume when user starts call.
* commit 'e8106736688d60b730873969dba4b60a64cae5e3': SOUND: set incall volume when user starts call.
Diffstat (limited to 'libaudio')
-rw-r--r--libaudio/AudioHardware.cpp18
-rw-r--r--libaudio/AudioHardware.h3
2 files changed, 17 insertions, 4 deletions
diff --git a/libaudio/AudioHardware.cpp b/libaudio/AudioHardware.cpp
index 5261860..865ca05 100644
--- a/libaudio/AudioHardware.cpp
+++ b/libaudio/AudioHardware.cpp
@@ -85,6 +85,7 @@ AudioHardware::AudioHardware() :
mPcmOpenCnt(0),
mMixerOpenCnt(0),
mInCallAudioMode(false),
+ mVoiceVol(1.0f),
mInputSource(AUDIO_SOURCE_DEFAULT),
mBluetoothNrec(true),
mTTYMode(TTY_MODE_OFF),
@@ -383,6 +384,7 @@ status_t AudioHardware::setMode(int mode)
openPcmOut_l();
openMixer_l();
setInputSource_l(AUDIO_SOURCE_DEFAULT);
+ setVoiceVolume_l(mVoiceVol);
mInCallAudioMode = true;
}
if (mMode == AudioSystem::MODE_NORMAL && mInCallAudioMode) {
@@ -540,12 +542,21 @@ size_t AudioHardware::getInputBufferSize(uint32_t sampleRate, int format, int ch
return AudioStreamInALSA::getBufferSize(sampleRate, channelCount);
}
-
status_t AudioHardware::setVoiceVolume(float volume)
{
- LOGD("### setVoiceVolume");
-
AutoMutex lock(mLock);
+
+ setVoiceVolume_l(volume);
+
+ return NO_ERROR;
+}
+
+void AudioHardware::setVoiceVolume_l(float volume)
+{
+ LOGD("### setVoiceVolume_l");
+
+ mVoiceVol = volume;
+
if ( (AudioSystem::MODE_IN_CALL == mMode) && (mSecRilLibHandle) &&
(connectRILDIfRequired() == OK) ) {
@@ -589,7 +600,6 @@ status_t AudioHardware::setVoiceVolume(float volume)
setCallVolume(mRilClient, type, int_volume);
}
- return NO_ERROR;
}
status_t AudioHardware::setMasterVolume(float volume)
diff --git a/libaudio/AudioHardware.h b/libaudio/AudioHardware.h
index c7da999..fb94e95 100644
--- a/libaudio/AudioHardware.h
+++ b/libaudio/AudioHardware.h
@@ -118,6 +118,8 @@ public:
status_t setInputSource_l(audio_source source);
+ void setVoiceVolume_l(float volume);
+
static uint32_t getInputSampleRate(uint32_t sampleRate);
sp <AudioStreamInALSA> getActiveInput_l();
@@ -153,6 +155,7 @@ private:
uint32_t mPcmOpenCnt;
uint32_t mMixerOpenCnt;
bool mInCallAudioMode;
+ float mVoiceVol;
audio_source mInputSource;
bool mBluetoothNrec;