From 7bc531a7e5dbfb45d05a99f7f6a18c57e0ff77dd Mon Sep 17 00:00:00 2001 From: Changgyu Choi Date: Tue, 19 Jul 2022 16:22:35 +0900 Subject: [PATCH] Change GetRWPath() This patch change return path of GetRWPath() to default path. So, it removed libsessiond dependency. Change-Id: Ic5fcd280b886acf2e53e79191f97d5f3b08c037d Signed-off-by: Changgyu Choi --- CMakeLists.txt | 2 -- aul/app_info/directory_info.cc | 33 +++------------------------------ packaging/aul.spec | 1 - 3 files changed, 3 insertions(+), 33 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6835e06..5fd9ace 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,6 @@ PKG_CHECK_MODULES(GIO_DEPS REQUIRED gio-2.0) PKG_CHECK_MODULES(GLIB_DEPS REQUIRED glib-2.0) PKG_CHECK_MODULES(GMOCK_DEPS REQUIRED gmock) PKG_CHECK_MODULES(INIPARSER_DEPS REQUIRED iniparser) -PKG_CHECK_MODULES(LIBSESSIOND_DEPS REQUIRED libsessiond) PKG_CHECK_MODULES(LIBSMACK_DEPS REQUIRED libsmack) PKG_CHECK_MODULES(LIBTZPLATFORM_CONFIG_DEPS REQUIRED libtzplatform-config) PKG_CHECK_MODULES(LIBXML_DEPS REQUIRED libxml-2.0) @@ -108,7 +107,6 @@ APPLY_PKG_CONFIG(${TARGET_AUL} PUBLIC GIO_DEPS GLIB_DEPS INIPARSER_DEPS - LIBSESSIOND_DEPS LIBSMACK_DEPS LIBTZPLATFORM_CONFIG_DEPS LIBXML_DEPS diff --git a/aul/app_info/directory_info.cc b/aul/app_info/directory_info.cc index 6dd261c..846eff9 100644 --- a/aul/app_info/directory_info.cc +++ b/aul/app_info/directory_info.cc @@ -15,7 +15,6 @@ * */ -#include #include #include #include @@ -38,37 +37,12 @@ constexpr const char kTepResourceDir[] = "tep/mount/"; constexpr const char kSharedDataDir[] = "shared/data/"; constexpr const char kSharedTrustedDir[] = "shared/trusted/"; constexpr const char kSharedResourceDir[] = "shared/res/"; -constexpr const char kSubssesionDir[] = "subsession/"; constexpr const char kAppRWDir[] = "apps_rw/"; constexpr const char kLightUserSwitchModeDefault[] = "default"; -std::string GetCurrentLightUser(uid_t uid) { - subsession_user_t user{}; - int ret = subsession_get_current_user(uid, user); - if (ret != TIZEN_ERROR_NONE) { - _E("Failed to get subsession current user. error(%d)", ret); - return ""; - } - - return user; -} - -std::string GetRWPath(const std::string& pkg_id, - const std::string& light_user_switch_mode, uid_t uid) { - std::string path; +std::string GetRWPath(const std::string& pkg_id, uid_t uid) { tzplatform_set_user(uid); - - if (light_user_switch_mode != kLightUserSwitchModeDefault) { - std::string current_user = GetCurrentLightUser(uid); - if (!current_user.empty()) { - path = std::string(tzplatform_getenv(TZ_USER_HOME)) + "/" + kSubssesionDir - + current_user + "/" + kAppRWDir + pkg_id; - } - } - - if (path.empty()) - path = std::string(tzplatform_getenv(TZ_USER_APP)) + "/" + pkg_id; - + std::string path = std::string(tzplatform_getenv(TZ_USER_APP)) + "/" + pkg_id; tzplatform_reset_user(); return path; } @@ -143,8 +117,7 @@ DirectoryInfo* DirectoryInfo::Get(const std::string app_id, return nullptr; std::string root_path = info->GetRootPath(); - std::string rw_path = GetRWPath(info->GetPkgId(), - info->GetLightUserSwitchMode(), uid); + std::string rw_path = GetRWPath(info->GetPkgId(), uid); return Builder().SetRootPath(info->GetRootPath()) .SetDataPath(GetPath(rw_path, kDataDir)) .SetCachePath(GetPath(rw_path, kCacheDir)) diff --git a/packaging/aul.spec b/packaging/aul.spec index 39ff166..07dbded 100644 --- a/packaging/aul.spec +++ b/packaging/aul.spec @@ -26,7 +26,6 @@ BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(gmock) BuildRequires: pkgconfig(iniparser) -BuildRequires: pkgconfig(libsessiond) BuildRequires: pkgconfig(libsmack) BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(libxml-2.0) -- 2.7.4