merge private 2.2_release submit/tizen_2.2/20130714.135045 submit/tizen_2.2/20130714.143752
authorJaeho Lee <jaeho81.lee@samsung.com>
Mon, 24 Jun 2013 07:10:20 +0000 (16:10 +0900)
committerJaeho Lee <jaeho81.lee@samsung.com>
Mon, 24 Jun 2013 07:10:20 +0000 (16:10 +0900)
Signed-off-by: Jaeho Lee <jaeho81.lee@samsung.com>
include/app_service.h
include/app_service_private.h
packaging/capi-appfw-application.spec
src/service.c

index eae2c5e..fc8bab3 100755 (executable)
@@ -31,6 +31,9 @@ extern "C" {
  */
 
 
+typedef struct _bundle_t bundle;
+
+
 /**
  * @brief Service handle.
  */
@@ -278,6 +281,17 @@ int service_destroy(service_h service);
 
 
 /**
+ * @brief Converts the service handle to bundle data.
+ *
+ * @param [in] service The service handle
+ * @param [out] data a bundle data on success
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #SERVICE_ERROR_NONE Successful
+ * @retval #SERVICE_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int service_to_bundle(service_h service, bundle **data);
+
+/**
  * @brief Sets the operation to be performed.
  *
  * @details The @a operation is the mandatory information for the launch request.
index 6f71533..f5a4963 100755 (executable)
@@ -28,8 +28,6 @@ int service_create_request(bundle *data, service_h *service);
 
 int service_create_event(bundle *data, service_h *service);
 
-int service_to_bundle(service_h service, bundle **data);
-
 #ifdef __cplusplus
 }
 #endif
index be89ed2..af7d029 100755 (executable)
@@ -1,7 +1,7 @@
 Name:       capi-appfw-application
 Summary:    An Application library in SLP C API
 Version:    0.1.0
-Release:    54
+Release:    55
 Group:      API
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
index e01f86a..7c88313 100755 (executable)
@@ -60,6 +60,7 @@ struct service_s {
        int id;
        service_type_e type;
        bundle *data;
+       int launch_pid;
 };
 
 typedef struct service_request_context_s {
@@ -265,6 +266,7 @@ int service_create_request(bundle *data, service_h *service)
        }
 
        service_request->id = service_new_id();
+       service_request->launch_pid = -1;
 
        *service = service_request;
 
@@ -754,6 +756,26 @@ int service_send_launch_request(service_h service, service_reply_cb callback, vo
                }
        }
 
+       service->launch_pid = launch_pid;
+
+       return SERVICE_ERROR_NONE;
+}
+
+
+int service_send_terminate_request(service_h service)
+{
+       if (service_valiate_service(service))
+       {
+               return service_error(SERVICE_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+       }
+
+       if(service->type != SERVICE_TYPE_REQUEST || service->launch_pid < 0)
+       {
+               return service_error(SERVICE_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+       }
+
+       appsvc_subapp_terminate_request_pid(service->launch_pid);
+
        return SERVICE_ERROR_NONE;
 }