#ifdef TIZEN_FEATURE_BT_HPS
static GDBusProxy *hps_gproxy;
#endif
+static gboolean factory_test_mode;
void _bt_core_fill_garray_from_variant(GVariant *var, GArray *param)
{
{
GVariant *variant = NULL;
unsigned char enabled;
-
+ GError *err = NULL;
BT_DBG(" ");
hps_gproxy = _bt_core_gdbus_get_hps_proxy();
}
variant = g_dbus_proxy_call_sync(hps_gproxy, "enable",
- NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
+ NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, &err);
+ if (err) {
+ BT_ERR("Error : %s" , err->message);
+ g_clear_error(&err);
+ }
if (variant) {
g_variant_get(variant, "(y)", &enabled);
BT_ERR("HPS enabled status 0x%x", enabled);
{
GVariant *variant = NULL;
unsigned char enabled;
-
+ GError *err = NULL;
BT_DBG(" ");
hps_gproxy = _bt_core_gdbus_get_hps_proxy();
}
variant = g_dbus_proxy_call_sync(hps_gproxy, "disable",
- NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
+ NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, &err);
+ if (err) {
+ BT_ERR("Error : %s" , err->message);
+ g_clear_error(&err);
+ }
if (variant) {
g_variant_get(variant, "(y)", &enabled);
BT_ERR("HPS disabled status 0x%x", enabled);
GArray **out_param1)
{
GDBusProxy *proxy;
- GVariant *ret;
+ GVariant *ret = NULL;
GVariant *param1;
GVariant *param2;
GVariant *param3;
g_variant_get(parameters, "(&s&s)", &type, &arg);
ret = _bt_core_factory_test_mode(type, arg);
- g_dbus_method_invocation_return_value(invocation,
+ factory_test_mode = TRUE;
+
+ if (ret == TRUE)
+ g_dbus_method_invocation_return_value(invocation,
g_variant_new("(i)", ret));
+ else
+ _bt_core_terminate();
+
return;
} else {
ret = FALSE;
{
gboolean flight_mode_status;
- BT_DBG("");
-
flight_mode_status = _bt_core_is_flight_mode_enabled();
if (flight_mode_status == FALSE && _bt_is_flightmode_request() == TRUE) {
if ((g_strcmp0(name, "org.bluez") == 0) ||
(g_strcmp0(name, "org.projectx.bt") == 0)) {
BT_DBG("%s is terminated", name);
- if (_bt_check_terminating_condition() == TRUE) {
+ if (_bt_check_terminating_condition() == TRUE && factory_test_mode == FALSE) {
_bt_disable_adapter();
_bt_disable_adapter_le();
_bt_core_terminate();
node_info->interfaces[0],
&method_table,
NULL, NULL, &error);
+ g_dbus_node_info_unref(node_info);
if (obj_id == 0) {
BT_ERR("Failed to register: %s", error->message);
g_error_free(error);