Updated for adding a type for closing PD
authorSung-jae Park <nicesj.park@samsung.com>
Fri, 28 Feb 2014 07:14:15 +0000 (16:14 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Fri, 28 Feb 2014 07:14:15 +0000 (16:14 +0900)
Change-Id: I2519e7776ba15aa51b462e4059a89b7bec0b8afd

include/instance.h
packaging/data-provider-master.spec
src/instance.c
src/server.c
util_liveinfo/src/liveinfo.c

index c802e55..27a0018 100644 (file)
@@ -209,7 +209,7 @@ extern void instance_slave_set_pd_pos(struct inst_info *inst, double x, double y
 extern void instance_slave_get_pd_pos(struct inst_info *inst, double *x, double *y);
 
 extern int instance_slave_open_pd(struct inst_info *inst, struct client_node *client);
-extern int instance_slave_close_pd(struct inst_info *inst, struct client_node *client);
+extern int instance_slave_close_pd(struct inst_info *inst, struct client_node *client, int reason);
 
 extern int instance_freeze_updator(struct inst_info *inst);
 extern int instance_thaw_updator(struct inst_info *inst);
index 8d34692..4a79924 100755 (executable)
@@ -1,6 +1,6 @@
 Name: data-provider-master
 Summary: Master service provider for liveboxes
-Version: 0.34.4
+Version: 0.34.5
 Release: 1
 Group: HomeTF/Livebox
 License: Flora
index 495a77f..b739db3 100644 (file)
@@ -1371,7 +1371,7 @@ static int pd_buffer_close_cb(struct client_node *client, void *inst)
 {
        int ret;
 
-       ret = instance_slave_close_pd(inst, client);
+       ret = instance_slave_close_pd(inst, client, LB_CLOSE_PD_NORMAL);
        if (ret < 0) {
                DbgPrint("Forcely close the PD ret: %d\n", ret);
        }
@@ -1391,7 +1391,7 @@ static int pd_script_close_cb(struct client_node *client, void *inst)
                DbgPrint("Unload script: %d\n", ret);
        }
 
-       ret = instance_slave_close_pd(inst, client);
+       ret = instance_slave_close_pd(inst, client, LB_CLOSE_PD_NORMAL);
        if (ret < 0) {
                DbgPrint("Forcely close the PD ret: %d\n", ret);
        }
@@ -3046,7 +3046,7 @@ HAPI int instance_slave_open_pd(struct inst_info *inst, struct client_node *clie
        return ret;
 }
 
-HAPI int instance_slave_close_pd(struct inst_info *inst, struct client_node *client)
+HAPI int instance_slave_close_pd(struct inst_info *inst, struct client_node *client, int reason)
 {
        const char *pkgname;
        const char *id;
@@ -3080,7 +3080,7 @@ HAPI int instance_slave_close_pd(struct inst_info *inst, struct client_node *cli
                return LB_STATUS_ERROR_INVALID;
        }
 
-       packet = packet_create_noack("pd_hide", "ss", pkgname, id);
+       packet = packet_create_noack("pd_hide", "ssi", pkgname, id, reason);
        if (!packet) {
                ErrPrint("Failed to create a packet\n");
                return LB_STATUS_ERROR_FAULT;
index 59d70a1..76a9cc2 100644 (file)
@@ -292,7 +292,7 @@ static int slave_fault_open_script_cb(struct slave_node *slave, void *data)
        Ecore_Timer *timer;
 
        (void)script_handler_unload(instance_pd_script(data), 1);
-       (void)instance_slave_close_pd(data, instance_pd_owner(data));
+       (void)instance_slave_close_pd(data, instance_pd_owner(data), LB_CLOSE_PD_FAULT);
        (void)instance_client_pd_created(data, LB_STATUS_ERROR_FAULT);
 
        timer = instance_del_data(data, LAZY_PD_OPEN_TAG);
@@ -309,7 +309,7 @@ static int slave_fault_open_buffer_cb(struct slave_node *slave, void *data)
 {
        Ecore_Timer *timer;
 
-       (void)instance_slave_close_pd(data, instance_pd_owner(data));
+       (void)instance_slave_close_pd(data, instance_pd_owner(data), LB_CLOSE_PD_FAULT);
        (void)instance_client_pd_created(data, LB_STATUS_ERROR_FAULT);
 
        timer = instance_del_data(data, PD_OPEN_MONITOR_TAG);
@@ -362,7 +362,7 @@ static int slave_fault_resize_buffer_cb(struct slave_node *slave, void *data)
 {
        Ecore_Timer *timer;
 
-       (void)instance_slave_close_pd(data, instance_pd_owner(data));
+       (void)instance_slave_close_pd(data, instance_pd_owner(data), LB_CLOSE_PD_FAULT);
        (void)instance_client_pd_destroyed(data, LB_STATUS_ERROR_FAULT);
 
        timer = instance_del_data(data, PD_RESIZE_MONITOR_TAG);
@@ -5020,7 +5020,7 @@ static Eina_Bool pd_open_monitor_cb(void *inst)
                }
        }
 
-       (void)instance_slave_close_pd(inst, instance_pd_owner(inst));
+       (void)instance_slave_close_pd(inst, instance_pd_owner(inst), LB_CLOSE_PD_TIMEOUT);
        (void)instance_client_pd_created(inst, LB_STATUS_ERROR_TIMEOUT);
        (void)instance_del_data(inst, PD_OPEN_MONITOR_TAG);
        (void)instance_unref(inst);
@@ -5062,7 +5062,7 @@ static Eina_Bool pd_resize_monitor_cb(void *inst)
                }
        }
 
-       (void)instance_slave_close_pd(inst, instance_pd_owner(inst));
+       (void)instance_slave_close_pd(inst, instance_pd_owner(inst), LB_CLOSE_PD_TIMEOUT);
        (void)instance_client_pd_destroyed(inst, LB_STATUS_ERROR_TIMEOUT);
        (void)instance_del_data(inst, PD_RESIZE_MONITOR_TAG);
        (void)instance_unref(inst);
@@ -5145,7 +5145,7 @@ static struct packet *client_create_pd(pid_t pid, int handle, const struct packe
                        if (ret != LB_STATUS_SUCCESS) {
                                int tmp_ret;
 
-                               tmp_ret = instance_slave_close_pd(inst, client);
+                               tmp_ret = instance_slave_close_pd(inst, client, LB_CLOSE_PD_FAULT);
                                if (tmp_ret < 0) {
                                        ErrPrint("Unable to send script event for openning PD [%s], %d\n", pkgname, tmp_ret);
                                }
@@ -5243,7 +5243,7 @@ static struct packet *client_create_pd(pid_t pid, int handle, const struct packe
                                        ret = script_handler_unload(instance_pd_script(inst), 1);
                                        ErrPrint("Unload script: %d\n", ret);
 
-                                       ret = instance_slave_close_pd(inst, client);
+                                       ret = instance_slave_close_pd(inst, client, LB_CLOSE_PD_NORMAL);
                                        ErrPrint("Close PD %d\n", ret);
 
                                        inst = instance_unref(inst);
@@ -5271,7 +5271,7 @@ static struct packet *client_create_pd(pid_t pid, int handle, const struct packe
                                }
                        } else {
                                int tmp_ret;
-                               tmp_ret = instance_slave_close_pd(inst, client);
+                               tmp_ret = instance_slave_close_pd(inst, client, LB_CLOSE_PD_FAULT);
                                if (tmp_ret < 0) {
                                        ErrPrint("Unable to load script: %d, (close: %d)\n", ret, tmp_ret);
                                }
@@ -5373,7 +5373,7 @@ static struct packet *client_destroy_pd(pid_t pid, int handle, const struct pack
                                ErrPrint("PD close signal emit failed: %d\n", ret);
                        }
 
-                       ret = instance_slave_close_pd(inst, client);
+                       ret = instance_slave_close_pd(inst, client, LB_CLOSE_PD_NORMAL);
                        if (ret < 0) {
                                ErrPrint("PD close request failed: %d\n", ret);
                        }
@@ -5412,7 +5412,7 @@ static struct packet *client_destroy_pd(pid_t pid, int handle, const struct pack
                                ErrPrint("PD close signal emit failed: %d\n", ret);
                        }
 
-                       ret = instance_slave_close_pd(inst, client);
+                       ret = instance_slave_close_pd(inst, client, LB_CLOSE_PD_NORMAL);
                        if (ret < 0) {
                                ErrPrint("PD close request failed: %d\n", ret);
                        } else if (resize_aborted) {
@@ -5475,7 +5475,7 @@ static struct packet *client_destroy_pd(pid_t pid, int handle, const struct pack
                 * Send request to the slave.
                 * The SLAVE must has to repsonse this via "release_buffer" method.
                 */
-               ret = instance_slave_close_pd(inst, client);
+               ret = instance_slave_close_pd(inst, client, LB_CLOSE_PD_NORMAL);
                if (ret < 0) {
                        ErrPrint("Unable to close the PD: %s, %d\n", pkgname, ret);
                }
index fc79bf6..5102738 100644 (file)
@@ -1863,7 +1863,7 @@ int main(int argc, char *argv[])
        int c;
 
        do {
-               c = getopt_long(argc, argv, "b:hv:", long_options, &option_index);
+               c = getopt_long(argc, argv, "b:hv:x:", long_options, &option_index);
                switch (c) {
                case 'b':
                        if (!optarg || !*optarg) {