fix and add some prototype to suppress build warnings 91/61991/2 accepted/tizen/common/20160317.155414 accepted/tizen/ivi/20160315.001449 accepted/tizen/mobile/20160315.001402 accepted/tizen/tv/20160315.001412 accepted/tizen/wearable/20160315.001427 submit/tizen/20160314.031145 submit/tizen_common/20160316.154911
authorJunghyun Yeon <jungh.yeon@samsung.com>
Sat, 12 Mar 2016 04:39:44 +0000 (13:39 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 14 Mar 2016 02:30:56 +0000 (19:30 -0700)
Change-Id: Ib62e03d5ac11ae4e9ed8c40014f6433d9fd94703
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
comm/pkgmgr_installer.c
comm/pkgmgr_installer.h

index f523476..16cdd4a 100644 (file)
@@ -538,7 +538,7 @@ API int pkgmgr_installer_set_request_type(pkgmgr_installer *pi, int request_type
        return 0;
 }
 
-API int pkgmgr_installer_set_session_id(pkgmgr_installer *pi, char *session_id)
+API int pkgmgr_installer_set_session_id(pkgmgr_installer *pi, const char *session_id)
 {
        if (pi == NULL || session_id == NULL)
                return -1;
index aaa3856..07b02bb 100644 (file)
@@ -583,6 +583,49 @@ int main(int argc, char **argv)
 int pkgmgr_installer_get_is_preload(pkgmgr_installer *pi);
 
 /**
+       @brief          Send a app status signal
+       @pre            None
+       @post           None
+       @see            None
+       @param[in]      pi      pkgmgr_installer object
+       @param[in]      pkg_type        package type: "deb", "jar", "wgt", ...
+       @param[in]      pkgid   package id
+       @param[in]      appid   application id
+       @param[in]      key                     Signal key
+       @param[in]      val                     Signal value
+       @return         Operation result
+       @retval         0 on success
+       @retval         -errno on failure
+       @code
+#include <pkgmgr_installer.h>
+void send_app_singal(uid_t uid, int request_type, int req_id,
+               const char *pkg_type, const char *pkgid, const char *appid,
+               const char *key, const char *val)
+{
+       pkgmgr_installer *pi;
+       int r = 0;
+
+       pi = pkgmgr_installer_new();
+       if(!pi) return -1;
+
+       if (pkgmgr_installer_set_uid(pi, uid))
+               goto CLEANUP_RET;
+       if (pkgmgr_installer_set_request_type(pi, request_type))
+               goto CLEANUP_RET;
+       if ((pkgmgr_installer_set_session_id(pi, req_id))
+               goto CLEANUP_RET;
+       pkgmgr_installer_send_app_signal(pi, pkg_type, pkgid, appid, key, val);
+
+}
+       @endcode
+ */
+int pkgmgr_installer_send_app_signal(pkgmgr_installer *pi,
+                            const char *pkg_type,
+                            const char *pkgid,
+                            const char *appid,
+                            const char *key, const char *val);
+
+/**
        @brief          Send a process status signal
        @pre            None
        @post           None
@@ -700,7 +743,7 @@ int pkgmgr_installer_set_request_type(pkgmgr_installer *pi, int request_type);
  * @param[in]  session_id                              session ID to be set
  * @return     0 if success, error code(<0) if fail\n
 */
-int pkgmgr_installer_set_session_id(pkgmgr_installer *pi, char *session_id);
+int pkgmgr_installer_set_session_id(pkgmgr_installer *pi, const char *session_id);
 
 /**
  * @brief      This API creates the certinfo handle.