The gadget informations are added to the bundle.
The launchpad attempts to mount with the set bundle information.
Change-Id: Ic204ed61ac0d9b7a78b27d860695c0ce1bcb7a19
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
return 0;
AddDataToBundle(info->GetPkgIds(), context->GetBundle(),
- AUL_K_MOUNT_RES_PKGIDS);
+ AUL_K_MOUNT_RES_PKGIDS);
AddDataToBundle(info->GetAllowedPaths(), context->GetBundle(),
- AUL_K_MOUNT_ALLOWED_RES_DIR);
+ AUL_K_MOUNT_ALLOWED_RES_DIR);
AddDataToBundle(info->GetGlobalPaths(), context->GetBundle(),
- AUL_K_MOUNT_GLOBAL_RES_DIR);
+ AUL_K_MOUNT_GLOBAL_RES_DIR);
AddDataToBundle(info->GetAllowedLibPaths(), context->GetBundle(),
- AUL_K_MOUNT_ALLOWED_LIB_RES_DIR);
+ AUL_K_MOUNT_ALLOWED_LIB_RES_DIR);
AddDataToBundle(info->GetGlobalLibPaths(), context->GetBundle(),
- AUL_K_MOUNT_GLOBAL_LIB_RES_DIR);
-
+ AUL_K_MOUNT_GLOBAL_LIB_RES_DIR);
+ AddDataToBundle(info->GetGadgetPkgIds(), context->GetBundle(),
+ AUL_K_MOUNT_GADGET_PKGIDS);
+ AddDataToBundle(info->GetGadgetPaths(), context->GetBundle(),
+ AUL_K_MOUNT_GADGET_PATHS);
return 0;
}
constexpr const char ALLOWED_SUFFIX[] = "/res/allowed";
constexpr const char GLOBAL_SUFFIX[] = "/res/global";
+constexpr const char kGadgetPrefix[] = "org.tizen.appfw.gadget.";
ResMountPackageInfo::ResMountPackageInfo(
const std::vector<std::shared_ptr<ResPkgInfo>>& allowed_packages,
pkg->GetRootPath() + ALLOWED_SUFFIX + "/" + pkg->GetResType());
else
allowed_paths_.emplace_back(pkg->GetRootPath() + ALLOWED_SUFFIX);
+
+ if (pkg->GetResType().length() < strlen(kGadgetPrefix))
+ continue;
+
+ if (!pkg->GetResType().compare(0, strlen(kGadgetPrefix), kGadgetPrefix)) {
+ gadget_pkgids_.insert(pkg->GetPkgId());
+ gadget_paths_.emplace_back(pkg->GetRootPath() + ALLOWED_SUFFIX);
+ }
}
+
for (const auto& pkg : global_packages) {
pkgids_.insert(pkg->GetPkgId());
if (pkg->IsLib())
std::optional<ResMountPackageInfo>* info);
const std::set<std::string>& GetPkgIds() const { return pkgids_; }
+
const std::vector<std::string>& GetAllowedPaths() const {
return allowed_paths_;
}
+
const std::vector<std::string>& GetGlobalPaths() const {
return global_paths_;
}
+
const std::vector<std::string>& GetAllowedLibPaths() const {
return allowed_lib_paths_;
}
+
const std::vector<std::string>& GetGlobalLibPaths() const {
return global_lib_paths_;
}
+ const std::set<std::string>& GetGadgetPkgIds() const {
+ return gadget_pkgids_;
+ }
+
+ const std::vector<std::string>& GetGadgetPaths() const {
+ return gadget_paths_;
+ }
+
private:
std::set<std::string> pkgids_;
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::set<std::string> gadget_pkgids_;
+ std::vector<std::string> gadget_paths_;
};
} // namespace amd