Merge branch private-master
authorjunsuk77.oh <junsuk77.oh@samsung.com>
Mon, 10 Jun 2013 04:55:48 +0000 (13:55 +0900)
committerAnas Nashif <anas.nashif@intel.com>
Wed, 25 Sep 2013 03:57:58 +0000 (23:57 -0400)
Change-Id: I757bc9fc6513c1cec06b0031316177aded282def
Signed-off-by: junsuk77.oh <junsuk77.oh@samsung.com>
packaging/app2sd.spec
plugin/app2sd/CMakeLists.txt
plugin/app2sd/src/app2sd_interface.c
plugin/app2sd/src/app2sd_internals_registry.c
src/app2ext_interface.c

index 9eab81f..3937d92 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       app2sd
 Summary:    Application installation on external memory
-Version:    0.5.15
+Version:    0.5.18
 Release:    1
 Group:      Application Framework/Application Installer
 License:    Apache-2.0
index 4d3ca20..fa4aaea 100755 (executable)
@@ -3,13 +3,13 @@ PROJECT(app2sd C)
 
 ### Required packages
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED libssl dlog openssl db-util pkgmgr-info)
+pkg_check_modules(pkgs REQUIRED libssl dlog openssl db-util pkgmgr-info vconf)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-pkg_check_modules(libpkgs REQUIRED libssl dlog openssl db-util pkgmgr-info)
+pkg_check_modules(libpkgs REQUIRED libssl dlog openssl db-util pkgmgr-info vconf)
 
 FOREACH(flag ${libpkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 15b5e4b..6d1c21a 100755 (executable)
@@ -27,6 +27,7 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <pkgmgr-info.h>
+#include <vconf.h>
 
 #define MAX_BUF_LEN    1024
 #define APP2SD_TMP_PATH "/opt/usr/apps/tmp"
@@ -489,10 +490,6 @@ int app2sd_move_installed_app(const char *pkgid, GList* dir_list,
                        app2ext_move_type move_type)
 {
        int ret = 0;
-       char device_path[MAX_BUF_LEN] = {'\0', };
-       FILE* file = NULL;
-       int fd = 0;
-       char buf[MAX_BUF_LEN] = {'\0'};
 
        /*Validate function arguments*/
        if (pkgid == NULL || dir_list == NULL
@@ -538,22 +535,8 @@ int app2sd_move_installed_app(const char *pkgid, GList* dir_list,
        }
 
 END:
-       snprintf(device_path, MAX_BUF_LEN, "%s/app2sd_%s", APP2SD_TMP_PATH, pkgid);
 
-       file = fopen(device_path, "w");
-       if (file == NULL) {
-               app2ext_print("fopen failed\n");
-       }
-
-       snprintf(buf, MAX_BUF_LEN - 1, "%d\n", ret);
-       fwrite(buf, 1, strlen(buf), file);
-
-       if (file != NULL) {
-               fflush(file);
-               fd = fileno(file);
-               fsync(fd);
-               fclose(file);
-       }
+       vconf_set_int(VCONFKEY_PKGMGR_STATUS, ret);
 
        return ret;
 }
index b0d0f2e..4f9c57e 100755 (executable)
@@ -110,7 +110,7 @@ int _app2sd_set_password_in_db(const char *pkgid,
        char query[MAX_QUERY_LEN] = { 0, };
        char *error_message = NULL;
 
-       snprintf(query, MAX_QUERY_LEN, "insert into app2sd(pkgid,password)\
+       sqlite3_snprintf(MAX_QUERY_LEN, query, "insert into app2sd(pkgid,password)\
                        values ('%s','%s')", pkgid, passwd);
 
        if (SQLITE_OK != sqlite3_exec(app2sd_db, query, NULL, NULL,
@@ -135,7 +135,7 @@ int _app2sd_remove_password_from_db(const char *pkgid)
        char query[MAX_QUERY_LEN] = { 0 };
        char *error_message = NULL;
 
-       snprintf(query, MAX_QUERY_LEN,
+       sqlite3_snprintf(MAX_QUERY_LEN, query,
                 "delete from app2sd where pkgid LIKE '%s'", pkgid);
        app2ext_print("\n deletion querys is %s ", query);
 
@@ -165,7 +165,7 @@ char *_app2sd_get_password_from_db(const char *pkgid)
        int rc = 0;
        char *passwd = NULL;
 
-       snprintf(query, MAX_QUERY_LEN,
+       sqlite3_snprintf(MAX_QUERY_LEN, query,
                 "select * from app2sd where pkgid LIKE '%s'", pkgid);
        app2ext_print("\n access querys is %s ", query);
 
index 673d7ee..24fa434 100755 (executable)
@@ -122,10 +122,7 @@ int app2ext_get_app_location(const char *appname)
 
        /*check whether application is in external memory or not */
        fp = fopen(app_mmc_path, "r");
-       if (fp == NULL) {
-               app2ext_print
-               (" app path in external memory not accesible\n");
-       } else {
+       if (fp != NULL) {
                fclose(fp);
                fp = NULL;
                return APP2EXT_SD_CARD;
@@ -134,8 +131,6 @@ int app2ext_get_app_location(const char *appname)
        /*check whether application is in internal or not */
        fp = fopen(app_dir_path, "r");
        if (fp == NULL) {
-               app2ext_print
-               (" app path in internal memory not accesible\n");
                return APP2EXT_NOT_INSTALLED;
        } else {
                fclose(fp);