[bt-core] Fix FactoryTestMode method call 50/139450/1
authorAnurag Biradar <biradar.a@samsung.com>
Wed, 19 Jul 2017 04:33:04 +0000 (10:03 +0530)
committerAnurag Biradar <biradar.a@samsung.com>
Wed, 19 Jul 2017 04:33:04 +0000 (10:03 +0530)
bluetooth-testmode Application is not getting method reply for FactoryTestMode
methode call

bt-core was terminating itself before replying dbus method call

Change-Id: Ife0aabda0e4ecc9040b30271f8397b9d2749a919
Measure: terminate bt-core after replying to dbus method call

bt-core/bt-core-adapter.c
bt-core/bt-core-dbus-handler.c

index 54264aa..9b45b72 100644 (file)
@@ -692,7 +692,6 @@ gboolean _bt_core_factory_test_mode(const char *type, const char *arg)
                arg_list[0] = "bt-enable-rf-channel.sh";
                arg_list[1] = (char *)arg;
        } else {
-               _bt_core_terminate();
                return FALSE;
        }
 
@@ -700,7 +699,6 @@ gboolean _bt_core_factory_test_mode(const char *type, const char *arg)
        if (__execute_command(cmd, arg_list) < 0)
                BT_ERR("running script failed");
 
-       _bt_core_terminate();
        return TRUE;
 }
 
index 34c34c7..5eb2894 100755 (executable)
@@ -387,6 +387,7 @@ static void __bt_core_dbus_method(GDBusConnection *connection,
                ret = _bt_core_factory_test_mode(type, arg);
                g_dbus_method_invocation_return_value(invocation,
                                g_variant_new("(i)", ret));
+               _bt_core_terminate();
                 return;
        } else {
                ret = FALSE;