Change GetRWPath() 45/278345/7
authorChanggyu Choi <changyu.choi@samsung.com>
Tue, 19 Jul 2022 07:22:35 +0000 (16:22 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Fri, 5 Aug 2022 01:09:44 +0000 (10:09 +0900)
This patch change return path of GetRWPath() to default path.
So, it removed libsessiond dependency.

Change-Id: Ic5fcd280b886acf2e53e79191f97d5f3b08c037d
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
CMakeLists.txt
aul/app_info/directory_info.cc
packaging/aul.spec

index 6835e06..5fd9ace 100644 (file)
@@ -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
index 6dd261c..846eff9 100644 (file)
@@ -15,7 +15,6 @@
  *
  */
 
-#include <sessiond.h>
 #include <sys/types.h>
 #include <tzplatform_config.h>
 #include <unistd.h>
@@ -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))
index 39ff166..07dbded 100644 (file)
@@ -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)