Only allowed package can use lib rpk.
A lib rpk can contains resources for lib.
Change-Id: I49e6d5ef35c58ea49402aa234e1139c8e7b44b95
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
AUL_K_MOUNT_ALLOWED_RES_DIR);
AddDataToBundle(info->GetGlobalPaths(), context->GetBundle(),
AUL_K_MOUNT_GLOBAL_RES_DIR);
- AddDataToBundle(info->GetAllowedLibPaths(), context->GetBundle(),
- AUL_K_MOUNT_ALLOWED_LIB_RES_DIR);
- AddDataToBundle(info->GetGlobalLibPaths(), context->GetBundle(),
- AUL_K_MOUNT_GLOBAL_LIB_RES_DIR);
+ AddDataToBundle(info->GetLibPaths(), context->GetBundle(),
+ AUL_K_MOUNT_LIB_DIR);
AddDataToBundle(info->GetGadgetPkgIds(), context->GetBundle(),
AUL_K_MOUNT_GADGET_PKGIDS);
AddDataToBundle(info->GetGadgetPaths(), context->GetBundle(),
constexpr const char ALLOWED_SUFFIX[] = "/res/allowed";
constexpr const char GLOBAL_SUFFIX[] = "/res/global";
constexpr const char kGadgetPrefix[] = "org.tizen.appfw.gadget.";
+constexpr const char kLibDir[] = "/lib";
ResMountPackageInfo::ResMountPackageInfo(
const std::vector<std::shared_ptr<ResPkgInfo>>& allowed_packages,
gadget_paths_.emplace_back(pkg->GetRootPath() + ALLOWED_SUFFIX);
}
- if (pkg->IsLib()) {
- allowed_lib_paths_.emplace_back(pkg->GetRootPath() + ALLOWED_SUFFIX +
- "/" + pkg->GetResType());
- } else {
- allowed_paths_.emplace_back(pkg->GetRootPath() + ALLOWED_SUFFIX);
- }
- }
+ if (pkg->IsLib())
+ lib_paths_.emplace_back(pkg->GetRootPath() + kLibDir);
- for (const auto& pkg : global_packages) {
- if (pkg->IsLib()) {
- global_lib_paths_.emplace_back(pkg->GetRootPath() + GLOBAL_SUFFIX + "/" +
- pkg->GetResType());
- } else {
- global_paths_.emplace_back(pkg->GetRootPath() + GLOBAL_SUFFIX);
- }
+ allowed_paths_.emplace_back(pkg->GetRootPath() + ALLOWED_SUFFIX);
}
+
+ for (const auto& pkg : global_packages)
+ global_paths_.emplace_back(pkg->GetRootPath() + GLOBAL_SUFFIX);
}
static int ResInfoGetGadgetResPackagesInfo(
return global_paths_;
}
-const std::vector<std::string>&
-ResMountPackageInfo::GetAllowedLibPaths() const {
- return allowed_lib_paths_;
-}
-
-const std::vector<std::string>& ResMountPackageInfo::GetGlobalLibPaths() const {
- return global_lib_paths_;
+const std::vector<std::string>& ResMountPackageInfo::GetLibPaths() const {
+ return lib_paths_;
}
const std::set<std::string>& ResMountPackageInfo::GetGadgetPkgIds() const {
const std::vector<std::string>& GetAllowedPaths() const;
const std::vector<std::string>& GetGlobalPaths() const;
- const std::vector<std::string>& GetAllowedLibPaths() const;
- const std::vector<std::string>& GetGlobalLibPaths() const;
+ const std::vector<std::string>& GetLibPaths() const;
const std::set<std::string>& GetGadgetPkgIds() const;
const std::vector<std::string>& GetGadgetPaths() const;
private:
std::vector<std::string> allowed_paths_;
std::vector<std::string> global_paths_;
- std::vector<std::string> allowed_lib_paths_;
- std::vector<std::string> global_lib_paths_;
+ std::vector<std::string> lib_paths_;
std::set<std::string> gadget_pkgids_;
std::vector<std::string> gadget_paths_;
};