Handle error value of hid agent 42/241942/2
authorDeokhyun Kim <dukan.kim@samsung.com>
Mon, 6 Jul 2020 06:40:56 +0000 (15:40 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Fri, 21 Aug 2020 05:26:49 +0000 (05:26 +0000)
Change-Id: If227159bde4292304583995417996c5af7b9f406
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
bt-api/bt-hid-device.c

index c9b851a..806fc31 100644 (file)
@@ -626,7 +626,8 @@ BT_EXPORT_API int bluetooth_hid_device_activate(void)
                BT_ERR("Error returned in method call");
                if (err) {
                        BT_ERR("Error = %s", err->message);
-                       if (strcmp(err->message, BT_ERROR_ALREADY_EXIST) == 0)
+                       g_dbus_error_strip_remote_error(err);
+                       if (g_strrstr(err->message, BT_ERROR_ALREADY_EXIST))
                                ret = BLUETOOTH_ERROR_IN_PROGRESS;
                        else
                                ret = BLUETOOTH_ERROR_INTERNAL;
@@ -662,7 +663,8 @@ BT_EXPORT_API int bluetooth_hid_device_deactivate(void)
                BT_ERR("Error returned in method call");
                if (err) {
                        BT_ERR("Error = %s", err->message);
-                       if (strcmp(err->message, BT_ERROR_NOT_AVAILABLE) == 0)
+                       g_dbus_error_strip_remote_error(err);
+                       if (g_strrstr(err->message, BT_ERROR_NOT_AVAILABLE))
                                ret = BLUETOOTH_ERROR_NOT_IN_OPERATION;
                        else
                                ret = BLUETOOTH_ERROR_INTERNAL;