void *data);
/**
+ * @brief This API request to stop listen the pkgmgr's broadcasting
+ *
+ * This API is for package-manager client application.\n
+ *
+ * @param[in] pc pkgmgr_client
+ * @return 0 if success, error code(<0) if fail\n
+ * @retval PKGMGR_R_OK success
+ * @retval PKGMGR_R_EINVAL invalid argument
+ * @retval PKGMGR_R_ERROR internal error
+*/
+int pkgmgr_client_remove_listen_status(pkgmgr_client *pc);
+
+/**
* @brief This API broadcasts pkgmgr's status
*
* This API is for package-manager client application.\n
return NULL;
}
+static int __remove_stat_cbinfo(pkgmgr_client_t *pc)
+{
+ listen_cb_info *info = pc->info.listening.lhead;
+ listen_cb_info *next = NULL;
+
+ while (info != NULL) {
+ next = info->next;
+ free(info);
+ info = next;
+ }
+
+ pc->info.listening.lhead = NULL;
+ return 0;
+}
+
static void __add_app_stat_cbinfo(pkgmgr_client_t *pc, int request_id,
pkgmgr_app_handler event_cb, void *data)
{
return req_id;
}
+API int pkgmgr_client_remove_listen_status(pkgmgr_client *pc)
+{
+ int ret = -1;
+
+ retvm_if(pc == NULL, PKGMGR_R_EINVAL, "package manager client pc is NULL");
+ pkgmgr_client_t *mpc = (pkgmgr_client_t *) pc;
+
+ ret = __remove_stat_cbinfo(mpc);
+ if (ret != 0) {
+ ERR("failed to remove status callback");
+ return PKGMGR_R_ERROR;
+ }
+
+ return PKGMGR_R_OK;
+}
+
API int pkgmgr_client_broadcast_status(pkgmgr_client *pc, const char *pkg_type,
const char *pkgid, const char *key,
const char *val)