Do not update box when it is paused.
authorSung-jae Park <nicesj.park@samsung.com>
Tue, 2 Jul 2013 02:09:41 +0000 (11:09 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Tue, 2 Jul 2013 02:09:41 +0000 (11:09 +0900)
[model] Redwood
[binary_type] AP
[customer] Docomo/Orange/Open
[issue#] N/A
[problem] Box is updated if it is triggered from other process.
[cause] Slave doesn't check the pause state of a box.
[solution] Check the box's state, if it is paused, just increase the update counter. when it gets resume event, append it to pended updated list.
[team] HomeTF
[request]
[horizontal_expansion]

Change-Id: Ice6a32487470c29104e010d72000eacd8c606ecf

packaging/com.samsung.data-provider-slave.spec
src/lb.c

index fe8fd44..d1b6531 100644 (file)
@@ -2,7 +2,7 @@
 
 Name: com.samsung.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;
 }