std::string getResourcePaths(const std::string& rootPath)
{
- return rootPath + "/lib" + ":" + rootPath + "/res/allowed";
+ std::string paths = rootPath + "/lib" + ":" + rootPath + "/res/allowed";
+ char *resType = NULL;
+
+ pkgmgrinfo_pkginfo_h pkg_handle;
+ int ret = pkgmgrGetPkgInfo(getPkgId(rootPath), &pkg_handle);
+ if (ret != 0) {
+ return paths;
+ }
+ ret = pkgmgrinfo_pkginfo_get_res_type(pkg_handle, &resType);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_pkginfo_destroy_pkginfo(pkg_handle);
+ return paths;
+ }
+
+ paths += ":" + rootPath + "/res/allowed/" + resType;
+
+ pkgmgrinfo_pkginfo_destroy_pkginfo(pkg_handle);
+
+ return paths;
}
bool isRPK(const std::string& pkgId)