Add extended storage type for update installed storage 63/141363/3
authorSangyoon Jang <jeremy.jang@samsung.com>
Mon, 31 Jul 2017 06:53:17 +0000 (15:53 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Thu, 3 Aug 2017 02:48:22 +0000 (02:48 +0000)
Change-Id: I39af4c45fe53bdbbd0324c23783839b12089379b
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
include/pkgmgrinfo_type.h
src/pkgmgrinfo_db.c

index 175abf9..a2404f7 100644 (file)
@@ -451,6 +451,7 @@ typedef enum {
 typedef enum {
        INSTALL_INTERNAL = 0,           /**< Internal Installation*/
        INSTALL_EXTERNAL,               /**< External Installation*/
+       INSTALL_EXTENDED,               /**< Extended Installation*/
 } INSTALL_LOCATION;
 
 /**
index fc19d5c..37f2771 100644 (file)
@@ -439,6 +439,7 @@ API int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_
        sqlite3 *pkgmgr_parser_db = NULL;
        char *query = NULL;
        char *db_path;
+       const char *location_str;
 
        db_path = getUserPkgParserDBPathUID(uid);
        if (db_path == NULL) {
@@ -461,10 +462,16 @@ API int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_
        tryvm_if(ret != SQLITE_OK, ret = PMINFO_R_ERROR, "Failed to begin transaction\n");
        _LOGD("Transaction Begin\n");
 
+       if (location == INSTALL_INTERNAL)
+               location_str = "installed_internal";
+       else if (location == INSTALL_EXTERNAL)
+               location_str = "installed_external";
+       else
+               location_str = "installed_extended";
        /* pkgcakge_info table */
        query = sqlite3_mprintf(
                        "update package_info set installed_storage=%Q, external_path=%Q where package=%Q",
-                       location ? "installed_external" : "installed_internal", external_pkg_path, pkgid);
+                       location_str, external_pkg_path, pkgid);
 
        ret = sqlite3_exec(pkgmgr_parser_db, query, NULL, NULL, NULL);
        tryvm_if(ret != SQLITE_OK, ret = PMINFO_R_ERROR, "Don't execute query = %s\n", query);
@@ -473,7 +480,7 @@ API int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_
        /* package_app_info table */
        query = sqlite3_mprintf(
                        "update package_app_info set app_installed_storage=%Q, app_external_path=%Q where package=%Q",
-                       location ? "installed_external" : "installed_internal", external_pkg_path, pkgid);
+                       location_str, external_pkg_path, pkgid);
 
        ret = sqlite3_exec(pkgmgr_parser_db, query, NULL, NULL, NULL);
        tryvm_if(ret != SQLITE_OK, ret = PMINFO_R_ERROR, "Don't execute query = %s\n", query);