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>
Wed, 4 Jun 2025 06:53:10 +0000 (15:53 +0900)
Change-Id: If54321c97669092452c70475995b9c446d10b2a7

NativeLauncher/util/utils.cc

index d6b226d78f4bf8349247fa8bfb61f2d74c7894f7..d951450be78697d6ffc2c41110700bae47974b61 100644 (file)
@@ -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)