From: Divya Yadav Date: Wed, 27 Mar 2013 06:32:09 +0000 (+0530) Subject: P130323-4663 - Bluetooth visibility timer updation incorrect X-Git-Tag: 2.1b_release~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f5dd8ff9532cb04072805d9877d7c54a86b9883;p=apps%2Fnative%2Fug-bluetooth-efl.git P130323-4663 - Bluetooth visibility timer updation incorrect Issue: Sometimes visibility timer in UI updates from 5:00 to 4:58 directly and misses 4:59. Cause: Use of API g_timeout_add_seconds, whose definition says that the first call of the timer may not be precise for timeouts of one second. Fix: Use of API g_timeout_add resolves the problem Change-Id: I4f53545b98474b20cdb0c0e1343148ccbd259856 --- diff --git a/include/bt-type-define.h b/include/bt-type-define.h index 204814f..bd34727 100644 --- a/include/bt-type-define.h +++ b/include/bt-type-define.h @@ -59,6 +59,7 @@ extern "C" { #define BT_SEARCH_SERVICE_TIMEOUT 5 #define BT_SELECTED_TIMEOUT 5 #define BT_DELETED_TIMEOUT 2 +#define BT_VISIBILITY_TIMEOUT 1000 /* Define Error type */ #define BT_UG_FAIL -1 diff --git a/src/ui/bt-main-view.c b/src/ui/bt-main-view.c index 2190bfe..6892397 100644 --- a/src/ui/bt-main-view.c +++ b/src/ui/bt-main-view.c @@ -387,8 +387,8 @@ static void __bt_main_timeout_value_item_sel(void *data, Evas_Object *obj, /* Set current time snapshot */ time(&(ugd->start_time)); ugd->remain_time = timeout; - ugd->timeout_id = g_timeout_add_seconds(1, - __bt_main_visible_timeout_cb, ugd); + ugd->timeout_id = g_timeout_add(BT_VISIBILITY_TIMEOUT, + (GSourceFunc)__bt_main_visible_timeout_cb, ugd); } } @@ -3763,8 +3763,8 @@ void _bt_main_init_status(bt_ug_data *ugd, void *data) if (ugd->remain_time > 0) { /* Set current time snapshot */ time(&(ugd->start_time)); - ugd->timeout_id = g_timeout_add_seconds(1, - __bt_main_visible_timeout_cb, ugd); + ugd->timeout_id = g_timeout_add(BT_VISIBILITY_TIMEOUT, + (GSourceFunc)__bt_main_visible_timeout_cb, ugd); } else { ugd->visibility_timeout = 0; }