am 672e9ace: Merge "audio policy: tune voice/video chat volumes" into jb-mr1-dev

* commit '672e9ace42a3f7d4f93460efc79ebd444786a5eb':
  audio policy: tune voice/video chat volumes
This commit is contained in:
Eric Laurent 2012-10-18 10:59:59 -07:00 committed by Android Git Automerger
commit d22bb8f46c
2 changed files with 22 additions and 18 deletions

View file

@ -2616,13 +2616,23 @@ const AudioPolicyManagerBase::VolumeCurvePoint
{1, -30.0f}, {33, -26.0f}, {66, -22.0f}, {100, -18.0f}
};
const AudioPolicyManagerBase::VolumeCurvePoint
AudioPolicyManagerBase::sDefaultVoiceVolumeCurve[AudioPolicyManagerBase::VOLCNT] = {
{0, -42.0f}, {33, -28.0f}, {66, -14.0f}, {100, 0.0f}
};
const AudioPolicyManagerBase::VolumeCurvePoint
AudioPolicyManagerBase::sSpeakerVoiceVolumeCurve[AudioPolicyManagerBase::VOLCNT] = {
{0, -24.0f}, {33, -16.0f}, {66, -8.0f}, {100, 0.0f}
};
const AudioPolicyManagerBase::VolumeCurvePoint
*AudioPolicyManagerBase::sVolumeProfiles[AUDIO_STREAM_CNT]
[AudioPolicyManagerBase::DEVICE_CATEGORY_CNT] = {
{ // AUDIO_STREAM_VOICE_CALL
sDefaultVolumeCurve, // DEVICE_CATEGORY_HEADSET
sDefaultVolumeCurve, // DEVICE_CATEGORY_SPEAKER
sDefaultVolumeCurve // DEVICE_CATEGORY_EARPIECE
sDefaultVoiceVolumeCurve, // DEVICE_CATEGORY_HEADSET
sSpeakerVoiceVolumeCurve, // DEVICE_CATEGORY_SPEAKER
sDefaultVoiceVolumeCurve // DEVICE_CATEGORY_EARPIECE
},
{ // AUDIO_STREAM_SYSTEM
sHeadsetSystemVolumeCurve, // DEVICE_CATEGORY_HEADSET
@ -2650,9 +2660,9 @@ const AudioPolicyManagerBase::VolumeCurvePoint
sDefaultVolumeCurve // DEVICE_CATEGORY_EARPIECE
},
{ // AUDIO_STREAM_BLUETOOTH_SCO
sDefaultVolumeCurve, // DEVICE_CATEGORY_HEADSET
sDefaultVolumeCurve, // DEVICE_CATEGORY_SPEAKER
sDefaultVolumeCurve // DEVICE_CATEGORY_EARPIECE
sDefaultVoiceVolumeCurve, // DEVICE_CATEGORY_HEADSET
sSpeakerVoiceVolumeCurve, // DEVICE_CATEGORY_SPEAKER
sDefaultVoiceVolumeCurve // DEVICE_CATEGORY_EARPIECE
},
{ // AUDIO_STREAM_ENFORCED_AUDIBLE
sHeadsetSystemVolumeCurve, // DEVICE_CATEGORY_HEADSET
@ -2776,19 +2786,11 @@ status_t AudioPolicyManagerBase::checkAndSetVolume(int stream,
force) {
mOutputs.valueFor(output)->mCurVolume[stream] = volume;
ALOGVV("checkAndSetVolume() for output %d stream %d, volume %f, delay %d", output, stream, volume, delayMs);
if (stream == AudioSystem::VOICE_CALL ||
stream == AudioSystem::DTMF ||
stream == AudioSystem::BLUETOOTH_SCO) {
// offset value to reflect actual hardware volume that never reaches 0
// 1% corresponds roughly to first step in VOICE_CALL stream volume setting (see AudioService.java)
volume = 0.01 + 0.99 * volume;
// Force VOICE_CALL to track BLUETOOTH_SCO stream volume when bluetooth audio is
// enabled
if (stream == AudioSystem::BLUETOOTH_SCO) {
mpClientInterface->setStreamVolume(AudioSystem::VOICE_CALL, volume, output, delayMs);
}
// Force VOICE_CALL to track BLUETOOTH_SCO stream volume when bluetooth audio is
// enabled
if (stream == AudioSystem::BLUETOOTH_SCO) {
mpClientInterface->setStreamVolume(AudioSystem::VOICE_CALL, volume, output, delayMs);
}
mpClientInterface->setStreamVolume((AudioSystem::stream_type)stream, volume, output, delayMs);
}

View file

@ -227,6 +227,8 @@ protected:
static const VolumeCurvePoint sSpeakerSonificationVolumeCurve[AudioPolicyManagerBase::VOLCNT];
static const VolumeCurvePoint sDefaultSystemVolumeCurve[AudioPolicyManagerBase::VOLCNT];
static const VolumeCurvePoint sHeadsetSystemVolumeCurve[AudioPolicyManagerBase::VOLCNT];
static const VolumeCurvePoint sDefaultVoiceVolumeCurve[AudioPolicyManagerBase::VOLCNT];
static const VolumeCurvePoint sSpeakerVoiceVolumeCurve[AudioPolicyManagerBase::VOLCNT];
// default volume curves per stream and device category. See initializeVolumeCurves()
static const VolumeCurvePoint *sVolumeProfiles[AUDIO_STREAM_CNT][DEVICE_CATEGORY_CNT];