Don't try to update if a box is paused even though it is triggered by the 3rd process.
authorSung-jae Park <nicesj.park@samsung.com>
Tue, 2 Jul 2013 04:48:22 +0000 (13:48 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Tue, 2 Jul 2013 04:48:22 +0000 (13:48 +0900)
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
src/lb.c

index 5e98720..72e904a 100644 (file)
@@ -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
index 354bcf3..cef2511 100644 (file)
--- 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;
 }