summaryrefslogtreecommitdiffstats
path: root/libaudio
diff options
context:
space:
mode:
authorUK KIM <w0806.kim@samsung.com>2011-02-19 04:08:30 +0900
committerSimon Wilson <simonwilson@google.com>2011-03-03 17:02:41 -0800
commitd7657374cb9debe9e4763a5f9dce8b5088f82884 (patch)
tree9997863c87a347ed5ebfdc9ab6adc1c85b3e5930 /libaudio
parent1c87a6f0e59ddb9110de4795439a36d00ae70638 (diff)
downloaddevice_samsung_crespo-d7657374cb9debe9e4763a5f9dce8b5088f82884.zip
device_samsung_crespo-d7657374cb9debe9e4763a5f9dce8b5088f82884.tar.gz
device_samsung_crespo-d7657374cb9debe9e4763a5f9dce8b5088f82884.tar.bz2
SOUND: set incall volume when user starts call.
modem side doesn't store volume setting when device is rebooted. When audio mode is incall, set current voice volume to modem. Current incall volume is stored when upper layer sets or AudioService is started. Change-Id: Icfeb0273dda55354e207d464884ef99f41c5fdec Signed-off-by: UK KIM <w0806.kim@samsung.com>
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 45f0a2d..753c413 100644
--- a/libaudio/AudioHardware.cpp
+++ b/libaudio/AudioHardware.cpp
@@ -86,6 +86,7 @@ AudioHardware::AudioHardware() :
mPcmOpenCnt(0),
mMixerOpenCnt(0),
mInCallAudioMode(false),
+ mVoiceVol(1.0f),
mInputSource(AUDIO_SOURCE_DEFAULT),
mBluetoothNrec(true),
mTTYMode(TTY_MODE_OFF),
@@ -384,6 +385,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) {
@@ -541,12 +543,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) ) {
@@ -590,7 +601,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 a23e6c9..c4f04e8 100644
--- a/libaudio/AudioHardware.h
+++ b/libaudio/AudioHardware.h
@@ -119,6 +119,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();
@@ -154,6 +156,7 @@ private:
uint32_t mPcmOpenCnt;
uint32_t mMixerOpenCnt;
bool mInCallAudioMode;
+ float mVoiceVol;
audio_source mInputSource;
bool mBluetoothNrec;