From 3065cad0959a7c9364b5de198fc91f447b79fb8e Mon Sep 17 00:00:00 2001 From: "j-h.choi" Date: Mon, 4 Nov 2024 17:19:24 +0900 Subject: [PATCH] Added resource path for RPK type Change-Id: If54321c97669092452c70475995b9c446d10b2a7 --- NativeLauncher/util/utils.cc | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/NativeLauncher/util/utils.cc b/NativeLauncher/util/utils.cc index d6b226d..d951450 100644 --- a/NativeLauncher/util/utils.cc +++ b/NativeLauncher/util/utils.cc @@ -962,7 +962,25 @@ bool isNCDBStartupHookProvided() 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) -- 2.34.1