hal: Avoid resetting device to speaker for HDMI passthrough case

AudioPolicyManager closeOutput triggers resetting device to speaker
when playback ends. This results in an unexpected error in kernel
driver due incorrect topology being picked. Avoid resetting to speaker
device in hal to fix this issue.

Change-Id: Iee998dba7d2a38ef925aebe90d57ef081ad32942
CRs-Fixed: 761339
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 7b8f697..ca5055b 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1811,7 +1811,8 @@
         if ((out->devices == AUDIO_DEVICE_OUT_AUX_DIGITAL ||
                 out->devices == AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET) &&
                 val == AUDIO_DEVICE_NONE) {
-            val = AUDIO_DEVICE_OUT_SPEAKER;
+            if (!audio_extn_dolby_is_passthrough_stream(out->flags))
+                val = AUDIO_DEVICE_OUT_SPEAKER;
         }
 
         /*