From fc275aaec7ba399421db3a20e153b5b88c8c3605 Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Thu, 3 Apr 2014 17:21:58 +0900 Subject: [PATCH] Fix the bug of upgrading package. While upgrading packages, the instance's update period doesn't updated correctly. This patch will apply the new update period. But if the instance's update period is changed manually, (that is not same with in the XML), the master will not touch it. Only if the period is same with orignal value in the old XML, will be updated to the new value. Change-Id: I4e8e9f8a104a3010b6261ab77770960463051c84 --- include/instance.h | 1 + packaging/data-provider-master.spec | 2 +- src/instance.c | 5 +++++ src/package.c | 6 ++++++ src/xmonitor.c | 2 +- 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/instance.h b/include/instance.h index bb5d2d7..a61c32c 100644 --- a/include/instance.h +++ b/include/instance.h @@ -260,4 +260,5 @@ extern int instance_set_data(struct inst_info *inst, const char *tag, void *data extern void *instance_del_data(struct inst_info *inst, const char *tag); extern void *instance_get_data(struct inst_info *inst, const char *tag); +extern void instance_reload_period(struct inst_info *inst, double period); /* End of a file */ diff --git a/packaging/data-provider-master.spec b/packaging/data-provider-master.spec index 8eca2c7..838a0bf 100755 --- a/packaging/data-provider-master.spec +++ b/packaging/data-provider-master.spec @@ -2,7 +2,7 @@ Name: data-provider-master Summary: Master service provider for liveboxes -Version: 0.41.0 +Version: 0.41.1 Release: 1 Group: HomeTF/Livebox License: Flora diff --git a/src/instance.c b/src/instance.c index 513c0ea..32e6b91 100644 --- a/src/instance.c +++ b/src/instance.c @@ -2393,6 +2393,11 @@ static Eina_Bool timer_updator_cb(void *data) return ECORE_CALLBACK_CANCEL; } +HAPI void instance_reload_period(struct inst_info *inst, double period) +{ + inst->lb.period = period; +} + HAPI int instance_set_period(struct inst_info *inst, double period) { struct packet *packet; diff --git a/src/package.c b/src/package.c index c7377ce..30790e2 100644 --- a/src/package.c +++ b/src/package.c @@ -1292,9 +1292,12 @@ static inline void reload_package_info(struct pkg_info *info) unsigned int size_type; int width; int height; + double old_period; DbgPrint("Already exists, try to update it\n"); + old_period = info->lb.period; + group_del_livebox(info->lbid); package_clear_fault(info); @@ -1313,6 +1316,9 @@ static inline void reload_package_info(struct pkg_info *info) height = instance_lb_height(inst); size_type = livebox_service_size_type(width, height); if (info->lb.size_list & size_type) { + if (instance_period(inst) == old_period) { + instance_reload_period(inst, package_period(info)); + } instance_reload(inst, INSTANCE_DESTROY_UPGRADE); } else { instance_destroy(inst, INSTANCE_DESTROY_UNINSTALL); diff --git a/src/xmonitor.c b/src/xmonitor.c index 6f519c1..204a22d 100644 --- a/src/xmonitor.c +++ b/src/xmonitor.c @@ -369,7 +369,7 @@ static inline int enable_xmonitor(void) s_info.destroy_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY, destroy_cb, NULL); - if (!s_info.create_handler) { + if (!s_info.destroy_handler) { ErrPrint("Failed to add destroy event handler\n"); ecore_event_handler_del(s_info.create_handler); s_info.create_handler = NULL; -- 2.7.4