From 340bb0e1086020d6203d4f1e4d4ce3b76711d433 Mon Sep 17 00:00:00 2001 From: Anurag Biradar Date: Wed, 19 Jul 2017 10:13:41 +0530 Subject: [PATCH] bt-service: Bluetooth is Turn ON on every boot Once BT_OFF_DUE_TO_TIMEOUT vconf is set it will never unset the vconf. So, on each boot or bt-service launch bt is enabled even though BT was not enabled in previous session Before enabling BT during launch of bt-service, unset this vconf it is set Change-Id: I34bebcca8ceeae21c9c972bef21371925b29ffba --- bt-service/bt-service-main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bt-service/bt-service-main.c b/bt-service/bt-service-main.c index 4605d1f..155f354 100644 --- a/bt-service/bt-service-main.c +++ b/bt-service/bt-service-main.c @@ -162,6 +162,13 @@ static gboolean __bt_check_bt_service(void *data) if (vconf_get_int(BT_OFF_DUE_TO_TIMEOUT, &bt_off_due_to_timeout) != 0) BT_ERR("Fail to get BT_OFF_DUE_TO_TIMEOUT"); + if (bt_off_due_to_timeout) { + /* Set the vconf flag to 0 here, if BT need to be enabled + bt_off_due_to_timeout variable already hold the old value */ + if (vconf_set_int(BT_OFF_DUE_TO_TIMEOUT, 0) != 0 ) + BT_ERR("Set vconf failed"); + } + if ((bt_status != VCONFKEY_BT_STATUS_OFF || bt_off_due_to_timeout) && (status == BT_DEACTIVATED)) { BT_DBG("Previous session was enabled."); -- 2.7.4