/* function to move the application from/to SD Card */
int _app2sd_usr_move_app(const char *pkgid, app2ext_move_type move_cmd,
- GList *dir_list, uid_t uid, char *mmc_path);
+ GList *dir_list, uid_t uid, char *mmc_path, char **image_path);
/* utility to delete symbolic link */
void _app2sd_delete_symlink(const char *dirname);
* to pkgmgr_parser db
*/
pkgmgr_ret = pkgmgrinfo_pkginfo_set_usr_installed_storage(pkgid,
- INSTALL_EXTERNAL, uid);
+ INSTALL_EXTERNAL, loopback_device, uid);
if (pkgmgr_ret < 0) {
_E("fail to update installed location " \
"to db[%s, %d] of uid(%d), pkgmgr ret(%d)",
int ret = 0;
int pkgmgr_ret = 0;
char *sdpath = NULL;
+ char *image_path = NULL;
char mmc_path[FILENAME_MAX] = { 0, };
/* validate function arguments */
return ret;
}
- ret = _app2sd_usr_move_app(pkgid, move_type, dir_list, uid, mmc_path);
+ ret = _app2sd_usr_move_app(pkgid, move_type, dir_list, uid, mmc_path, &image_path);
if (ret) {
_D("unable to move application");
return ret;
/* if move is completed, then update installed storage to pkgmgr_parser db */
if (move_type == APP2EXT_MOVE_TO_EXT) {
pkgmgr_ret = pkgmgrinfo_pkginfo_set_usr_installed_storage(pkgid,
- INSTALL_EXTERNAL, uid);
+ INSTALL_EXTERNAL, image_path, uid);
if (pkgmgr_ret < 0) {
_E("failed to update installed location to db " \
"[%s, %s] of uid(%d), pkgmgr_ret(%d)",
}
} else {
pkgmgr_ret = pkgmgrinfo_pkginfo_set_usr_installed_storage(pkgid,
- INSTALL_INTERNAL, uid);
+ INSTALL_INTERNAL, image_path, uid);
if (pkgmgr_ret < 0) {
_E("failed to update installed location to db " \
"[%s, %s] of uid(%d), pkgmgr_ret(%d)",
}
static int _app2sd_move_app_to_external(const char *pkgid, GList *dir_list,
- uid_t uid, char *mmc_path)
+ uid_t uid, char *mmc_path, char **image_path)
{
int ret = APP2EXT_SUCCESS;
mode_t mode = DIR_PERMS;
goto ERR;
}
+ *image_path = strdup(loopback_device);
return APP2EXT_SUCCESS;
ERR:
device_node = NULL;
}
+ *image_path = NULL;
return ret;
}
}
int _app2sd_usr_move_app(const char *pkgid, app2ext_move_type move_type,
- GList *dir_list, uid_t uid, char *mmc_path)
+ GList *dir_list, uid_t uid, char *mmc_path, char **image_path)
{
int ret = APP2EXT_SUCCESS;
switch (move_type) {
case APP2EXT_MOVE_TO_EXT:
ret = _app2sd_move_app_to_external(pkgid, dir_list,
- uid, mmc_path);
+ uid, mmc_path, image_path);
if (ret) {
_E("move app to external memory failed(%d)", ret);
return ret;