### Required packages
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED libssl dlog openssl db-util)
+pkg_check_modules(pkgs REQUIRED libssl dlog openssl db-util pkgmgr-info)
FOREACH(flag ${pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
-pkg_check_modules(libpkgs REQUIRED libssl dlog openssl db-util)
+pkg_check_modules(libpkgs REQUIRED libssl dlog openssl db-util pkgmgr-info)
FOREACH(flag ${libpkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <pkgmgr-info.h>
int app2sd_pre_app_install(const char *pkgid, GList* dir_list,
int size)
buf_dir);
}
+ } else {
+ /*If the status is success, then update installed storage to pkgmgr_parser db*/
+ int rt = 0;
+ pkgmgrinfo_pkgdbinfo_h handle = NULL;
+ rt = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
+ if (rt < 0) {
+ app2ext_print("pkgmgrinfo_create_pkgdbinfo[%s] fail.. \n", pkgid);
+ }
+ rt = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_EXTERNAL);
+ if (rt < 0) {
+ app2ext_print("fail to update installed location to db[%s, %s]\n", pkgid, INSTALL_EXTERNAL);
+ }
+ rt =pkgmgrinfo_save_pkgdbinfo(handle);
+ if (rt < 0) {
+ app2ext_print("pkgmgrinfo_save_pkgdbinfo[%s] failed\n", pkgid);
+ }
+ rt =pkgmgrinfo_destroy_pkgdbinfo(handle);
+ if (rt < 0) {
+ app2ext_print("pkgmgrinfo_destroy_pkgdbinfo[%s] failed\n", pkgid);
+ }
}
return ret;
}
app2ext_print("App2Sd Error : Unable to move application\n");
return ret;
}
+
+ /*If move is completed, then update installed storage to pkgmgr_parser db*/
+ int rt = 0;
+ pkgmgrinfo_pkgdbinfo_h handle = NULL;
+ rt = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
+ if (rt < 0) {
+ app2ext_print("App2Sd Error : pkgmgrinfo_create_pkgdbinfo[%s] fail.. \n", pkgid);
+ }
+
+ if (move_type == APP2EXT_MOVE_TO_EXT) {
+ rt = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_EXTERNAL);
+ if (rt < 0) {
+ app2ext_print("App2Sd Error : fail to update installed location to db[%s, %s]\n", pkgid, INSTALL_EXTERNAL);
+ }
+ } else {
+ rt = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
+ if (rt < 0) {
+ app2ext_print("App2Sd Error : fail to update installed location to db[%s, %s]\n", pkgid, INSTALL_INTERNAL);
+ }
+ }
+ rt =pkgmgrinfo_save_pkgdbinfo(handle);
+ if (rt < 0) {
+ app2ext_print("pkgmgrinfo_save_pkgdbinfo[%s] failed\n", pkgid);
+ }
+ rt =pkgmgrinfo_destroy_pkgdbinfo(handle);
+ if (rt < 0) {
+ app2ext_print("pkgmgrinfo_destroy_pkgdbinfo failed\n");
+ }
+
return ret;
}