Added resource path for RPK type
authorj-h.choi <j-h.choi@samsung.com>
Mon, 4 Nov 2024 08:19:24 +0000 (17:19 +0900)
committerWoongsuk <ws77.cho@samsung.com>
Mon, 14 Apr 2025 04:33:58 +0000 (13:33 +0900)
Change-Id: If54321c97669092452c70475995b9c446d10b2a7

NativeLauncher/util/utils.cc

index 36d0a810b5b93bd4e0f5b155883da98011fe05be..ad9ec2f2f6bbc997ae659dfc8ac3acaa6c177454 100644 (file)
@@ -868,7 +868,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)