Audio: fix incorrect routing path.
Check output device is speaker first and then check if dock is plugged
in.
Change-Id: I7723f6de90bf0548320423c465e8950593df9e46
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 7018e6a..dd8769d 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -191,10 +191,12 @@
reset_mixer_state(adev->ar);
- if (speaker_on && !is_dock_in())
- audio_route_apply_path(adev->ar, "speaker");
- else
+ if (speaker_on) {
+ if(is_dock_in())
audio_route_apply_path(adev->ar, "dock");
+ else
+ audio_route_apply_path(adev->ar, "speaker");
+ }
if (headphone_on)
audio_route_apply_path(adev->ar, "headphone");
if (main_mic_on) {