From 0e0206f9bf1289d18418670450a1b5235c8e63b2 Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Tue, 2 Jul 2013 13:48:22 +0900 Subject: [PATCH] Don't try to update if a box is paused even though it is triggered by the 3rd process. Even though the box is paused, its content is updated when it is triggered from the 3rd process. There is no logic to prevent from updating. Check the state before update box. if it is paused, Increase the pending count and trigger it when the box is resumed. Change-Id: I1406e66f98140b55bd30cc3d7a7c1e01b7ff661f --- packaging/org.tizen.data-provider-slave.spec | 2 +- src/lb.c | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packaging/org.tizen.data-provider-slave.spec b/packaging/org.tizen.data-provider-slave.spec index 5e98720..72e904a 100644 --- a/packaging/org.tizen.data-provider-slave.spec +++ b/packaging/org.tizen.data-provider-slave.spec @@ -2,7 +2,7 @@ Name: org.tizen.data-provider-slave Summary: Plugin type livebox service provider. -Version: 0.12.1 +Version: 0.12.2 Release: 1 Group: HomeTF/Livebox License: Flora License diff --git a/src/lb.c b/src/lb.c index 354bcf3..cef2511 100644 --- a/src/lb.c +++ b/src/lb.c @@ -51,6 +51,8 @@ struct item { int is_paused; /* 1 is paused, 0 is resumed */ double sleep_at; + unsigned int updated_in_pause; + int is_lb_show; int is_pd_show; int is_lb_updated; @@ -593,11 +595,19 @@ static Eina_Bool updator_cb(void *data) } if (!IS_LB_SHOWN(item)) { - DbgPrint("%s is not shown yet. delaying updates\n", item->inst->item->pkgname); + DbgPrint("%s is not shown yet. make delay for updates\n", item->inst->item->pkgname); (void)append_pending_list(item); return ECORE_CALLBACK_RENEW; } + if (item->is_paused) { + item->updated_in_pause++; + DbgPrint("%s is paused[%d]. make delay for updating\n", item->inst->item->pkgname, item->updated_in_pause); + return ECORE_CALLBACK_RENEW; + } + + item->updated_in_pause = 0; + ret = so_is_updated(item->inst); if (ret <= 0) { if (so_need_to_destroy(item->inst) == NEED_TO_DESTROY) { @@ -1484,6 +1494,11 @@ HAPI void lb_resume_all(void) timer_thaw(item); lb_sys_event(item->inst, item, LB_SYS_EVENT_RESUMED); + + if (item->updated_in_pause) { + (void)append_pending_list(item); + item->updated_in_pause = 0; + } } } @@ -1557,6 +1572,12 @@ HAPI int lb_resume(const char *pkgname, const char *id) timer_thaw(item); lb_sys_event(inst, item, LB_SYS_EVENT_RESUMED); + + if (item->updated_in_pause) { + (void)append_pending_list(item); + item->updated_in_pause = 0; + } + return LB_STATUS_SUCCESS; } -- 2.7.4