Add the exception case for audio initialize 56/218256/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 21 Nov 2019 01:56:05 +0000 (10:56 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 21 Nov 2019 01:56:05 +0000 (10:56 +0900)
In case of 'AlreadyExist' error from bluez, BT FRWK should
enable the audio stack

Change-Id: Ia3394b21f057478b73a95603d63207669aed64bd
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-oal/bluez_hal/src/bt-hal-a2dp-sink-dbus-handler.c
bt-oal/bluez_hal/src/bt-hal-av-dbus-handler.c

index a507a66..e64f19a 100644 (file)
@@ -266,7 +266,16 @@ bt_status_t _bt_hal_dbus_handler_enable_a2dp_sink(void)
        if (ret == NULL) {
                ERR("Call SelectRole Failed");
                if (error) {
-                       ERR("errCode[%x], message[%s]", error->code, error->message);
+                       g_dbus_error_strip_remote_error(error);
+
+                       ERR("message[%s]", error->message);
+
+                       /* Add the exception case for Already Exists */
+                       if (g_strrstr(error->message, "Already Exists")) {
+                               g_clear_error(&error);
+                               return BT_STATUS_SUCCESS;
+                       }
+
                        g_clear_error(&error);
                }
                return BT_STATUS_FAIL;
index 847c55e..2e53a49 100644 (file)
@@ -266,7 +266,16 @@ bt_status_t _bt_hal_dbus_handler_enable_a2dp_source(void)
        if (ret == NULL) {
                ERR("Call SelectRole Failed");
                if (error) {
-                       ERR("errCode[%x], message[%s]", error->code, error->message);
+                       g_dbus_error_strip_remote_error(error);
+
+                       ERR("message[%s]", error->message);
+
+                       /* Add the exception case for Already Exists */
+                       if (g_strrstr(error->message, "Already Exists")) {
+                               g_clear_error(&error);
+                               return BT_STATUS_SUCCESS;
+                       }
+
                        g_clear_error(&error);
                }
                return BT_STATUS_FAIL;