* @param[in] pkgid application package id
* @param[in] move_type PM_MOVE_TO_INTERNAL or PM_MOVE_TO_SDCARD
* @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
+ * @param[in] event_cb user callback
+ * @param[in] data user data
* @param[in] uid the addressee user id of the instruction
* @retval PKGMGR_R_OK success
* @retval PKGMGR_R_EINVAL invalid argument
* @retval PKGMGR_R_ERROR general error
*/
int pkgmgr_client_move(pkgmgr_client *pc, const char *pkg_type,
- const char *pkgid, pkgmgr_move_type move_type, pkgmgr_mode mode);
-int pkgmgr_client_usr_move(pkgmgr_client *pc, const char *pkg_type,
- const char *pkgid, pkgmgr_move_type move_type, pkgmgr_mode mode, uid_t uid);
-/**
- * @brief This API moves installed package to SD card or vice versa.
- *
- * This API is for package-manager client application.\n
- *
- * @param[in] pc pkgmgr_client
- * @param[in] pkg_type package type
- * @param[in] pkgid application package id
- * @param[in] move_type PM_MOVE_TO_INTERNAL or PM_MOVE_TO_SDCARD
- * @param[in] mode installation mode - PM_DEFAULT, PM_QUIET
- * @param[in] event_cb user callback
- * @param[in] data user data
- * @retval PKGMGR_R_OK success
- * @retval PKGMGR_R_EINVAL invalid argument
- * @retval PKGMGR_R_ERROR general error
-*/
-int pkgmgr_client_move_pkg(pkgmgr_client *pc, const char *pkg_type,
- const char *pkgid, pkgmgr_move_type move_type, pkgmgr_mode mode,
+ const char *pkgid, pkgmgr_move_type move_type,
pkgmgr_handler event_cb, void *data);
+int pkgmgr_client_usr_move(pkgmgr_client *pc, const char *pkg_type,
+ const char *pkgid, pkgmgr_move_type move_type,
+ pkgmgr_handler event_cb, void *data, uid_t uid);
/**
* @brief This API activates package.
}
}
-static void __add_op_cbinfo(pkgmgr_client_t * pc, int request_id,
+static void __add_op_cbinfo(pkgmgr_client_t *pc, int request_id,
const char *req_key, pkgmgr_handler event_cb, void *new_event_cb,
void *data)
{
}
}
-static void __add_op_app_cbinfo(pkgmgr_client_t * pc, int request_id,
+static void __add_op_app_cbinfo(pkgmgr_client_t *pc, int request_id,
const char *req_key, pkgmgr_app_handler app_event_cb, void *data)
{
req_cb_info *cb_info;
/* find callback info */
cb_info = __find_op_cbinfo(pc, req_id);
if (cb_info == NULL) {
- ERR("cannot fint cb_info for req_id:%s", req_id);
+ ERR("cannot find cb_info for req_id:%s", req_id);
return;
}
{
int ret;
- ret = pkgmgr_client_usr_move(pc, pkg_type, pkgid, move_type, 0, uid);
+ ret = pkgmgr_client_usr_move(pc, pkg_type, pkgid, move_type, event_cb, data, uid);
if (ret < 0) {
ERR("move request failed");
return ret;
}
API int pkgmgr_client_move(pkgmgr_client *pc, const char *pkg_type,
- const char *pkgid, pkgmgr_move_type move_type, pkgmgr_mode mode)
+ const char *pkgid, pkgmgr_move_type move_type,
+ pkgmgr_handler event_cb, void *data)
{
- return pkgmgr_client_usr_move(pc, pkg_type, pkgid, move_type, mode,
- _getuid());
+ return pkgmgr_client_usr_move(pc, pkg_type, pkgid, move_type,
+ event_cb, data, _getuid());
}
API int pkgmgr_client_usr_move(pkgmgr_client *pc, const char *pkg_type,
const char *pkgid, pkgmgr_move_type move_type,
- pkgmgr_mode mode, uid_t uid)
+ pkgmgr_handler event_cb, void *data, uid_t uid)
{
GVariant *result;
int ret = PKGMGR_R_ECOMM;
+ int req_id;
+ char *req_key = NULL;
pkgmgr_client_t *mpc = (pkgmgr_client_t *)pc;
if (pc == NULL || pkg_type == NULL || pkgid == NULL) {
return ret;
}
- g_variant_get(result, "(i)", &ret);
+ g_variant_get(result, "(i&s)", &ret, &req_key);
+ if (req_key == NULL) {
+ g_variant_unref(result);
+ return PKGMGR_R_ECOMM;
+ }
+ if (ret != PKGMGR_R_OK) {
+ g_variant_unref(result);
+ return ret;
+ }
+
+ req_id = _get_request_id();
+ __add_op_cbinfo(mpc, req_id, req_key, event_cb, NULL, data);
g_variant_unref(result);
return ret;