Update the PATH for supporting multi-user 47/18947/1
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 3 Apr 2014 09:18:45 +0000 (18:18 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 3 Apr 2014 09:18:45 +0000 (18:18 +0900)
Change the policy of updating period info of instances for upgrading packages.

If the package is upgraded, its period should be changed for all instances.
but some instances which have changed their period by manually, is not affected by
upgraded information of a package.

Change-Id: Ibca629b92041233c90cddb677539c11275de292b

CMakeLists.txt
include/instance.h
packaging/data-provider-master.spec
src/instance.c
src/package.c
src/server.c

index 7fb73ae..4aa118b 100644 (file)
@@ -22,6 +22,7 @@ pkg_check_modules(pkg REQUIRED
        badge-service
        libsmack
        shortcut
+       libtzplatform-config
 )
 
 IF (X11_SUPPORT)
@@ -55,11 +56,6 @@ ADD_DEFINITIONS("-DPATH_MAX=256")
 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
 ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
 
-ADD_DEFINITIONS("-DINFO_SOCKET=\"/opt/usr/share/live_magazine/.live.socket\"")
-ADD_DEFINITIONS("-DCLIENT_SOCKET=\"/opt/usr/share/live_magazine/.client.socket\"")
-ADD_DEFINITIONS("-DSLAVE_SOCKET=\"/opt/usr/share/live_magazine/.slave.socket\"")
-ADD_DEFINITIONS("-DSERVICE_SOCKET=\"/opt/usr/share/live_magazine/.service.socket\"")
-
 ADD_DEFINITIONS("-DCLIENT_PORT=\"8208\"")
 
 ADD_DEFINITIONS("-DBADGE_SOCKET=\"/tmp/.badge.service\"")
index bb5d2d7..a61c32c 100644 (file)
@@ -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 */
index c83a6c6..48d53a6 100644 (file)
@@ -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
@@ -45,6 +45,8 @@ BuildRequires: pkgconfig(badge)
 BuildRequires: pkgconfig(badge-service)
 BuildRequires: pkgconfig(shortcut)
 BuildRequires: pkgconfig(security-server)
+BuildRequires: pkgconfig(libtzplatform-config)
+Requires: libtzplatform-config
 Requires(post): sys-assert
 Requires(post): dbus
 
index 513c0ea..32e6b91 100644 (file)
@@ -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;
index c7377ce..30790e2 100644 (file)
@@ -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);
index 1c73106..d86f3ce 100644 (file)
@@ -28,6 +28,8 @@
 #include <livebox-errno.h>
 #include <livebox-service.h>
 
+#include <tzplatform_config.h>
+
 #include "critical_log.h"
 #include "conf.h"
 #include "debug.h"
 #define LAZY_PD_OPEN_TAG "lazy,pd,open"
 #define LAZY_PD_CLOSE_TAG "lazy,pd,close"
 
+#define INFO_SOCKET tzplatform_mkpath(TZ_USER_SHARE,"live_magazine/.live.socket")
+#define CLIENT_SOCKET tzplatform_mkpath(TZ_USER_SHARE,"live_magazine/.client.socket")
+#define SLAVE_SOCKET tzplatform_mkpath(TZ_USER_SHARE,"live_magazine/.slave.socket")
+#define SERVICE_SOCKET tzplatform_mkpath(TZ_USER_SHARE,"live_magazine/.service.socket")
+
 static struct info {
        int info_fd;
        int client_fd;