#define PKGMGR_CLIENT_STATUS_ENABLE_APP_SPLASH_SCREEN 0x0200
#define PKGMGR_CLIENT_STATUS_DISABLE_APP_SPLASH_SCREEN 0x0400
#define PKGMGR_CLIENT_STATUS_CLEAR_CACHE 0x0800
+#define PKGMGR_CLIENT_STATUS_RES_COPY 0x1000
+#define PKGMGR_CLIENT_STATUS_RES_REMOVE 0x2000
+#define PKGMGR_CLIENT_STATUS_RES_UNINSTALL 0x4000
/** @} */
void *data);
/**
+ * @brief This API request to listen the pkgmgr's broadcasting about resource copy
+ *
+ * This API is for package-manager client application.\n
+ *
+ * @param[in] pc pkgmgr_client
+ * @param[in] event_cb user callback
+ * @param[in] data user data
+ * @return request_id (>0) if success, error code(<0) if fail\n
+ * @retval PKGMGR_R_OK success
+ * @retval PKGMGR_R_EINVAL invalid argument
+ * @retval PKGMGR_R_ENOMEM out of memory
+*/
+int pkgmgr_client_listen_res_copy_status(pkgmgr_client *pc,
+ pkgmgr_res_copy_handler event_cb, void *data);
+
+/**
* @brief This API request to stop listen the pkgmgr's broadcasting
*
* This API is for package-manager client application.\n
return cb_info->req_id;
}
+API int pkgmgr_client_listen_res_copy_status(pkgmgr_client *pc,
+ pkgmgr_res_copy_handler event_cb, void *data)
+{
+ int ret;
+ struct pkgmgr_client_t *client = (struct pkgmgr_client_t *)pc;
+ struct cb_info *cb_info;
+
+ if (pc == NULL || event_cb == NULL) {
+ ERR("invalid parameter");
+ return PKGMGR_R_EINVAL;
+ }
+
+ if (client->pc_type != PC_LISTENING) {
+ ERR("client->pc_type is not PC_LISTENING");
+ return PKGMGR_R_EINVAL;
+ }
+
+ cb_info = __create_res_copy_event_cb_info(client, event_cb, data, NULL);
+ if (cb_info == NULL)
+ return PKGMGR_R_ENOMEM;
+ cb_info->status_type = client->status_type;
+ ret = pkgmgr_client_connection_set_callback(client, cb_info);
+ if (ret != PKGMGR_R_OK) {
+ __free_cb_info(cb_info);
+ return ret;
+ }
+ client->cb_info_list = g_list_append(client->cb_info_list, cb_info);
+
+ return cb_info->req_id;
+}
+
API int pkgmgr_client_remove_listen_status(pkgmgr_client *pc)
{
struct pkgmgr_client_t *client = (struct pkgmgr_client_t *)pc;
PKGMGR_CLIENT_STATUS_ENABLE_APP_SPLASH_SCREEN},
{PKGMGR_INSTALLER_APP_DISABLE_SPLASH_SCREEN_EVENT_STR,
PKGMGR_CLIENT_STATUS_DISABLE_APP_SPLASH_SCREEN},
+ {PKGMGR_INSTALLER_RES_COPY_EVENT_STR, PKGMGR_CLIENT_STATUS_RES_COPY},
+ {PKGMGR_INSTALLER_RES_REMOVE_EVENT_STR,
+ PKGMGR_CLIENT_STATUS_RES_REMOVE},
+ {PKGMGR_INSTALLER_RES_UNINSTALL_EVENT_STR,
+ PKGMGR_CLIENT_STATUS_RES_UNINSTALL},
{NULL, -1}
};