Promotion of audio-userspace.lnx.2.1-00029.

CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1061424   I9086325d44106d683d31e6ddc366a4b5e18d19ea   hal: refine conditional logic when device connected/disc

Change-Id: I27c5f8cb48f4b1610a9de7a55e3204ceb0c3309e
CRs-Fixed: 1061424
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 7d3c824..43c83de 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -4109,7 +4109,7 @@
             ALOGV("cache new edid");
             platform_cache_edid(adev->platform);
         } else if ((val & AUDIO_DEVICE_OUT_USB_DEVICE) ||
-                   (val & AUDIO_DEVICE_IN_USB_DEVICE)) {
+                   !(val ^ AUDIO_DEVICE_IN_USB_DEVICE)) {
             /*
              * Do not allow AFE proxy port usage by WFD source when USB headset is connected.
              * Per AudioPolicyManager, USB device is higher priority than WFD.
@@ -4133,7 +4133,7 @@
             ALOGV("invalidate cached edid");
             platform_invalidate_hdmi_config(adev->platform);
         } else if ((val & AUDIO_DEVICE_OUT_USB_DEVICE) ||
-                   (val & AUDIO_DEVICE_IN_USB_DEVICE)) {
+                   !(val ^ AUDIO_DEVICE_IN_USB_DEVICE)) {
             ret = str_parms_get_str(parms, "card", value, sizeof(value));
             if (ret >= 0) {
                 audio_extn_usb_remove_device(val, atoi(value));