From: Sung-jae Park Date: Fri, 13 Dec 2013 08:48:02 +0000 (+0900) Subject: Add new event path for propagating the delete type. X-Git-Tag: submit/tizen_mobile/20150527.071719~2^2~48^2~21^2~103^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=23fd2f21883c01fe4d0503e7537ee3a34f4150b1;p=platform%2Fcore%2Fappfw%2Fdata-provider-master.git Add new event path for propagating the delete type. Change-Id: Ic36bfcbd5135167c628ef7b1df96fccd5cbcaa18 --- diff --git a/include/instance.h b/include/instance.h index cf04b3f..b9b8674 100644 --- a/include/instance.h +++ b/include/instance.h @@ -100,7 +100,8 @@ enum instance_destroy_type { INSTANCE_DESTROY_UNINSTALL = 0x02, INSTANCE_DESTROY_TERMINATE = 0x03, INSTANCE_DESTROY_FAULT = 0x04, - INSTANCE_DESTROY_UNKNOWN = 0x05, + INSTANCE_DESTROY_TEMPORARY = 0x05, + INSTANCE_DESTROY_UNKNOWN = 0x06 }; enum instance_state { diff --git a/packaging/data-provider-master.spec b/packaging/data-provider-master.spec index 73aeeca..4015984 100755 --- a/packaging/data-provider-master.spec +++ b/packaging/data-provider-master.spec @@ -1,6 +1,6 @@ Name: data-provider-master Summary: Master service provider for liveboxes -Version: 0.28.2 +Version: 0.29.0 Release: 1 Group: HomeTF/Livebox License: Flora diff --git a/src/main.c b/src/main.c index 7c1b7f6..9e40ac0 100755 --- a/src/main.c +++ b/src/main.c @@ -69,8 +69,8 @@ static inline int app_create(void) { int ret; - if (access(SLAVE_LOG_PATH, R_OK|W_OK) != 0) { - if (mkdir(SLAVE_LOG_PATH, 755) < 0) { + if (access(SLAVE_LOG_PATH, R_OK | W_OK) != 0) { + if (mkdir(SLAVE_LOG_PATH, 0755) < 0) { ErrPrint("Failed to create %s (%s)\n", SLAVE_LOG_PATH, strerror(errno)); } } diff --git a/src/server.c b/src/server.c index 295fd88..9c92be3 100644 --- a/src/server.c +++ b/src/server.c @@ -974,6 +974,7 @@ static struct packet *client_delete(pid_t pid, int handle, const struct packet * struct inst_info *inst; const struct pkg_info *pkg; int ret; + int type; client = client_find_by_rpc_handle(handle); if (!client) { @@ -982,12 +983,20 @@ static struct packet *client_delete(pid_t pid, int handle, const struct packet * goto out; } - ret = packet_get(packet, "ss", &pkgname, &id); - if (ret != 2) { + ret = packet_get(packet, "ssi", &pkgname, &id, &type); + if (ret != 3) { ErrPrint("Parameter is not matched\n"); ret = LB_STATUS_ERROR_INVALID; goto out; } + /*! + * \note + * Below two types must has to be sync'd with livebox-viewer + * + * LB_DELETE_PERMANENTLY = 0x01, + * LB_DELETE_TEMPORARY = 0x02, + * + */ /*! * \NOTE: @@ -1041,7 +1050,16 @@ static struct packet *client_delete(pid_t pid, int handle, const struct packet * ret = LB_STATUS_ERROR_PERMISSION; } } else { - ret = instance_destroy(inst, INSTANCE_DESTROY_DEFAULT); + switch (type) { + case LB_DELETE_PERMANENTLY: + ret = instance_destroy(inst, INSTANCE_DESTROY_DEFAULT); + break; + case LB_DELETE_TEMPORARY: + ret = instance_destroy(inst, INSTANCE_DESTROY_TEMPORARY); + break; + default: + break; + } } out: