From d5458299dd6ebb9b591024da6615c4c14cb9e34a Mon Sep 17 00:00:00 2001 From: Andrew Dodd Date: Sat, 14 Apr 2012 17:38:49 -0400 Subject: libaudio: Dock audio support Currently this routes media to the dock, but keeps call I/O on the device speaker. Works with Steven Harper's Samsung dock audio patches from 2-3 months ago. Change-Id: I41764f51f8c2df4d2f745ebdb8ada1abf0c29848 --- libaudio/AudioHardware.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libaudio') diff --git a/libaudio/AudioHardware.cpp b/libaudio/AudioHardware.cpp index f95b675..74fe6d2 100644 --- a/libaudio/AudioHardware.cpp +++ b/libaudio/AudioHardware.cpp @@ -719,6 +719,7 @@ void AudioHardware::setVoiceVolume_l(float volume) break; case AudioSystem::DEVICE_OUT_SPEAKER: + case AudioSystem::DEVICE_OUT_ANLG_DOCK_HEADSET: ALOGD("### speaker call volume"); type = SOUND_TYPE_SPEAKER; break; @@ -863,6 +864,7 @@ status_t AudioHardware::setIncallPath_l(uint32_t device) break; case AudioSystem::DEVICE_OUT_SPEAKER: + case AudioSystem::DEVICE_OUT_ANLG_DOCK_HEADSET: ALOGD("### incall mode speaker route"); path = SOUND_AUDIO_PATH_SPEAKER; break; @@ -1135,6 +1137,9 @@ const char *AudioHardware::getOutputRouteFromDevice(uint32_t device) switch (device) { case AudioSystem::DEVICE_OUT_EARPIECE: return "RCV"; + case AudioSystem::DEVICE_OUT_ANLG_DOCK_HEADSET: + if (mMode == AudioSystem::MODE_RINGTONE) return "RING_SPK"; + else return "EXTRA_DOCK_SPEAKER"; case AudioSystem::DEVICE_OUT_SPEAKER: if (mMode == AudioSystem::MODE_RINGTONE) return "RING_SPK"; else return "SPK"; @@ -1146,6 +1151,7 @@ const char *AudioHardware::getOutputRouteFromDevice(uint32_t device) else return "HP"; case (AudioSystem::DEVICE_OUT_SPEAKER|AudioSystem::DEVICE_OUT_WIRED_HEADPHONE): case (AudioSystem::DEVICE_OUT_SPEAKER|AudioSystem::DEVICE_OUT_WIRED_HEADSET): + case (AudioSystem::DEVICE_OUT_SPEAKER|AudioSystem::DEVICE_OUT_ANLG_DOCK_HEADSET): if (mMode == AudioSystem::MODE_RINGTONE) return "RING_SPK_HP"; else return "SPK_HP"; case AudioSystem::DEVICE_OUT_BLUETOOTH_SCO: @@ -1163,6 +1169,7 @@ const char *AudioHardware::getVoiceRouteFromDevice(uint32_t device) case AudioSystem::DEVICE_OUT_EARPIECE: return "RCV"; case AudioSystem::DEVICE_OUT_SPEAKER: + case AudioSystem::DEVICE_OUT_ANLG_DOCK_HEADSET: return "SPK"; case AudioSystem::DEVICE_OUT_WIRED_HEADPHONE: case AudioSystem::DEVICE_OUT_WIRED_HEADSET: -- cgit v1.1