libstorage: Support multi user by using tzplatform library 59/40359/1 accepted/tizen/common/20150605.124100 accepted/tizen/mobile/20150606.052849 accepted/tizen/tv/20150606.053608 accepted/tizen/wearable/20150606.054418 submit/tizen/20150604.062454
authorJiyoung Yun <jy910.yun@samsung.com>
Wed, 3 Jun 2015 02:47:20 +0000 (11:47 +0900)
committerJiyoung Yun <jy910.yun@samsung.com>
Wed, 3 Jun 2015 03:19:30 +0000 (12:19 +0900)
Storeage apis will return the proper directory path as per user accoount.

Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
Change-Id: I35e249a9396f52de0c09191e88f3cac89f758f92

CMakeLists.txt
packaging/libstorage.spec
src/storage-internal.c

index a8afe02..f621ade 100644 (file)
@@ -10,7 +10,7 @@ SET(VERSION 0.1)
 SET(INC_DIR include)
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/${INC_DIR})
 
-SET(dependents "dlog capi-base-common vconf glib-2.0")
+SET(dependents "dlog capi-base-common vconf glib-2.0 libtzplatform-config")
 SET(pc_dependents "capi-base-common")
 
 INCLUDE(FindPkgConfig)
index d16940d..501ed0d 100644 (file)
@@ -11,6 +11,7 @@ BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(capi-base-common)
 BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(glib-2.0)
+BuildRequires:  pkgconfig(libtzplatform-config)
 
 %description
 development package of library to get storage
index 036ca34..ca8b182 100755 (executable)
 #include <errno.h>
 #include <limits.h>
 #include <sys/statvfs.h>
+#include <tzplatform_config.h>
 
 #include "common.h"
 #include "log.h"
 
-#define INTERNAL_MEMORY_PATH   "/opt/usr/media"
 
 #ifndef __USE_FILE_OFFSET64
 int __WEAK__ storage_get_internal_memory_size(struct statvfs *buf);
@@ -60,7 +60,7 @@ static int internal_get_space(unsigned long long *total, unsigned long long *ava
 
 static const char *internal_get_root(void)
 {
-       return INTERNAL_MEMORY_PATH;
+       return tzplatform_getenv(TZ_USER_CONTENT);
 }
 
 const struct storage_ops internal = {