Add multi-user support 04/18204/3 accepted/tizen_ivi_panda tizen_ivi_panda accepted/tizen/ivi/panda/20140403.015126 submit/tizen_ivi_panda/20140403.011836
authorKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Tue, 18 Mar 2014 07:56:30 +0000 (08:56 +0100)
committerKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Tue, 18 Mar 2014 12:34:49 +0000 (13:34 +0100)
The DB was considered a system/global DB so this patch doesn't change
that. If the DB is meant to be a per user DB, "TZ_SYS_DB" will need to
be replaced with "TZ_USER_DB".

Also set a valid group tag.

Bug-Tizen: PTREL-327
Change-Id: I2006c70cde18e55aadcc0006dad87776e721c231
Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
inc/app2ext_interface.h
packaging/app2sd.spec
plugin/app2sd/CMakeLists.txt
plugin/app2sd/inc/app2sd_interface.h
plugin/app2sd/src/app2sd_interface.c
plugin/app2sd/src/app2sd_internals_registry.c

index 2177ddc..8b932d4 100755 (executable)
@@ -51,6 +51,10 @@ extern "C" {
 
 #include <dlog/dlog.h>
 #include <glib.h>
+
+/* For multi-user support */
+#include <tzplatform_config.h>
+
 #ifdef LOG_TAG
 #undef LOG_TAG
 #endif
@@ -66,7 +70,7 @@ extern "C" {
 #define APP2EXT_SUCCESS 0
 #define MMC_PATH "/opt/storage/sdcard"
 #define APP2SD_PATH MMC_PATH"/app2sd/"
-#define APP_INSTALLATION_PATH "/opt/usr/apps/"
+#define APP_INSTALLATION_PATH tzplatform_mkpath(TZ_USER_APP, "")
 
 /**
  * Enum for application installation location
index f139eaa..ceec704 100755 (executable)
@@ -1,8 +1,8 @@
 Name:       app2sd
 Summary:    Application installation on external memory
 Version:    0.5.27
-Release:    1
-Group:      Application Framework/Application Installer
+Release:    0
+Group:      Application Framework/Package Management
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 Source1001:     app2sd.manifest
@@ -14,6 +14,7 @@ BuildRequires:  pkgconfig(libssl)
 BuildRequires:  pkgconfig(openssl)
 BuildRequires:  pkgconfig(pkgmgr-info)
 BuildRequires:  pkgconfig(vconf)
+BuildRequires:  pkgconfig(libtzplatform-config)
 
 %description
 Tizen application installation on external memory
index fa4aaea..05e885a 100755 (executable)
@@ -3,7 +3,7 @@ PROJECT(app2sd C)
 
 ### Required packages
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED libssl dlog openssl db-util pkgmgr-info vconf)
+pkg_check_modules(pkgs REQUIRED libssl dlog openssl db-util pkgmgr-info vconf libtzplatform-config)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index a59cb9a..ad4ff65 100755 (executable)
@@ -58,7 +58,7 @@ extern "C" {
         *              It should be called before actual installation is done.
         * @pre                 vfat type sd card must be present.
         * @post                Installation is done by package installer.
-                       Encryption password is saved in db /opt/dbspace/.app2sd.db
+                       Encryption password is saved in db TZ_SYS_DB/.app2sd.db
         * @param[in] appname           application package name
          *                             [Ex: com.samsung.calculator]
         *This entry is parsed from application package control/manifest file.
index 86b48e7..089cd12 100755 (executable)
 #include <pkgmgr-info.h>
 #include <vconf.h>
 
+/* For multi-user support */
+#include <tzplatform_config.h>
+
 #define MAX_BUF_LEN    1024
-#define APP2SD_TMP_PATH "/opt/usr/apps/tmp"
+#define APP2SD_TMP_PATH tzplatform_mkpath(TZ_USER_APP, "tmp")
 
 int app2sd_pre_app_install(const char *pkgid, GList* dir_list,
                                int size)
index 4f9c57e..991c5aa 100755 (executable)
 #include <dlog.h>
 #include <time.h>
 #include <db-util.h>
+
+/* For multi-user support */
+#include <tzplatform_config.h>
+
 #define MAX_QUERY_LEN 4096
 #define PASSWORD_LENGTH 64
 /*
@@ -41,7 +45,7 @@
  */
 
 /*sqlite  db code*/
-#define APP2SD_DB_FILE "/opt/dbspace/.app2sd.db"
+#define APP2SD_DB_FILE tzplatform_mkpath(TZ_SYS_DB, ".app2sd.db")
 sqlite3 *app2sd_db;
 #define QUERY_CREATE_TABLE_APP2SD "create table app2sd \
        (pkgid text primary key,\