bt-service: Bluetooth is Turn ON on every boot 53/139453/1
authorAnurag Biradar <biradar.a@samsung.com>
Wed, 19 Jul 2017 04:43:41 +0000 (10:13 +0530)
committerAnurag Biradar <biradar.a@samsung.com>
Wed, 19 Jul 2017 04:43:41 +0000 (10:13 +0530)
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

index 4605d1f..155f354 100644 (file)
@@ -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.");