audio: fix audio drop when speaker is selected 2.
Commit 78a7609d fixed audio drop at the start of ringtone.
This commit fixes another similar issue with camera shutter sound being
dropped while in call over headset.
There was a workaround for this second issue in audio policy manager but this was
not satisfactory as it was impacting all devices for a problem that is
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index b4138a6..a26ea14 100644
@@ -1431,7 +1431,8 @@
(adev->devices & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET)) ||
(adev->devices & (AUDIO_DEVICE_OUT_AUX_DIGITAL |
- (val == AUDIO_DEVICE_OUT_SPEAKER))
+ ((val & AUDIO_DEVICE_OUT_SPEAKER) ^
+ (adev->devices & AUDIO_DEVICE_OUT_SPEAKER)))
adev->devices &= ~AUDIO_DEVICE_OUT_ALL;