Fix to check whether type is correct or not 44/71744/1
authorTaejin Woo <tt.woo@samsung.com>
Fri, 27 May 2016 02:57:24 +0000 (11:57 +0900)
committerTaejin Woo <tt.woo@samsung.com>
Fri, 27 May 2016 02:59:18 +0000 (11:59 +0900)
Change-Id: I4f820ce5396583128d4c2451a2fc4ec108e2ea07
Signed-off-by: Taejin Woo <tt.woo@samsung.com>
src/bluetooth-audio.c

index 3e5a14ade40daefd4c72875160abf4c4c12cdb69..0947aad3021a22e8511106aad811bba89a615d70 100644 (file)
@@ -240,9 +240,15 @@ int bt_audio_connect(const char *remote_address, bt_audio_profile_type_e type)
                BT_ERR("HSP NOT SUPPORTED(0x%08x)", BT_ERROR_NOT_SUPPORTED);
                type = BT_AUDIO_PROFILE_TYPE_A2DP;
 #else
-               BT_CHECK_AUDIO_INIT_STATUS();
-               BT_ERR("HSP and A2DP SUPPORTED");
-               type = BT_AUDIO_PROFILE_TYPE_ALL;
+               if (is_audio_ag_initialized == false) {
+                       BT_CHECK_A2DP_INIT_STATUS();
+                       BT_ERR("ALL connect flow, but this device is HSP NOT SUPPORTED(0x%08x)", BT_ERROR_NOT_SUPPORTED);
+                       type = BT_AUDIO_PROFILE_TYPE_A2DP;
+               } else {
+                       BT_CHECK_AUDIO_INIT_STATUS();
+                       BT_ERR("HSP and A2DP SUPPORTED");
+                       type = BT_AUDIO_PROFILE_TYPE_ALL;
+               }
 #endif
        }