change API for writing to db 95/60195/1
authorjongmyeongko <jongmyeong.ko@samsung.com>
Wed, 24 Feb 2016 06:17:26 +0000 (15:17 +0900)
committerjongmyeongko <jongmyeong.ko@samsung.com>
Wed, 24 Feb 2016 06:21:48 +0000 (15:21 +0900)
Requires :
https://review.tizen.org/gerrit/#/c/60194/

Change-Id: I54e0c7cc6de01e2b92b456c927b0e983d0738508
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
plugin/app2sd/src/app2sd_interface.c

index dba14c4..0a3db32 100755 (executable)
@@ -218,24 +218,11 @@ int app2sd_post_app_install(const char *pkgid,
                }
 
        } else {
-               /*If  the status is success, then update installed storage to pkgmgr_parser db*/
+               /*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);
+               rt = pkgmgrinfo_pkginfo_set_installed_storage(pkgid, INSTALL_EXTERNAL);
                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);
+                       app2ext_print("fail to update installed location to db[%s, %d]\n", pkgid, INSTALL_EXTERNAL);
                }
        }
        return ret;
@@ -562,33 +549,18 @@ int app2sd_move_installed_app(const char *pkgid, GList* dir_list,
                goto END;
        }
 
-       /*If  move is completed, then update installed storage to pkgmgr_parser db*/
-       pkgmgrinfo_pkgdbinfo_h handle = NULL;
-       pkgmgrinfo_ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
-       if (pkgmgrinfo_ret < 0) {
-               app2ext_print("App2Sd Error : pkgmgrinfo_create_pkgdbinfo[%s] fail.. \n", pkgid);
-       }
-
+       /*If move is completed, then update installed storage to pkgmgr_parser db*/
        if (move_type == APP2EXT_MOVE_TO_EXT) {
-               pkgmgrinfo_ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_EXTERNAL);
+               pkgmgrinfo_ret = pkgmgrinfo_pkginfo_set_installed_storage(pkgid, INSTALL_EXTERNAL);
                if (pkgmgrinfo_ret < 0) {
                        app2ext_print("App2Sd Error : fail to update installed location to db[%s, %s]\n", pkgid, INSTALL_EXTERNAL);
                }
        } else {
-               pkgmgrinfo_ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
+               pkgmgrinfo_ret = pkgmgrinfo_pkginfo_set_installed_storage(pkgid, INSTALL_INTERNAL);
                if (pkgmgrinfo_ret < 0) {
                        app2ext_print("App2Sd Error : fail to update installed location to db[%s, %s]\n", pkgid, INSTALL_INTERNAL);
                }
        }
-       pkgmgrinfo_ret =pkgmgrinfo_save_pkgdbinfo(handle);
-       if (pkgmgrinfo_ret < 0) {
-               app2ext_print("pkgmgrinfo_save_pkgdbinfo[%s] failed\n", pkgid);
-       }
-       pkgmgrinfo_ret =pkgmgrinfo_destroy_pkgdbinfo(handle);
-       if (pkgmgrinfo_ret < 0) {
-               app2ext_print("pkgmgrinfo_destroy_pkgdbinfo failed\n");
-       }
-
 END:
 
        _app2sd_make_result_info_file((char*)pkgid, ret);