Remove adding resource pakcage IDs to bundle object 92/304892/3
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 25 Jan 2024 06:54:27 +0000 (15:54 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 25 Jan 2024 09:58:44 +0000 (18:58 +0900)
Currently, NUIGadget feature uses gadget package IDs instead of
resource package IDs. The resource package IDs are not needed.
And, the gadget paths are removed from allowed paths and global paths.

Change-Id: I8856574c88ec30e3d081188c1e9dbe190c9d1461
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/launch/step_prepare_starting_app.cc
src/lib/res_info/res_mount_package_info.cc
src/lib/res_info/res_mount_package_info.hh

index e4c38a88472ae00848887fe0bee83e3ce2992f63..98fe164de29ed8c2a6420c56745df5a5d9094f0c 100644 (file)
@@ -643,8 +643,6 @@ int StepPrepareStartingApp::SetResPackagePaths(LaunchContext* context) {
   if (!info)
     return 0;
 
-  AddDataToBundle(info->GetPkgIds(), context->GetBundle(),
-                  AUL_K_MOUNT_RES_PKGIDS);
   AddDataToBundle(info->GetAllowedPaths(), context->GetBundle(),
                   AUL_K_MOUNT_ALLOWED_RES_DIR);
   AddDataToBundle(info->GetGlobalPaths(), context->GetBundle(),
index d1838fe0b876b91a3c92e075d1e541fb9a912cb3..2d16a85933b4db77a3a84bdf7f2d6b7b06e36e5c 100644 (file)
@@ -34,24 +34,21 @@ ResMountPackageInfo::ResMountPackageInfo(
     const std::vector<std::shared_ptr<ResPkgInfo>>& allowed_packages,
     const std::vector<std::shared_ptr<ResPkgInfo>>& global_packages) {
   for (const auto& pkg : allowed_packages) {
-    pkgids_.insert(pkg->GetPkgId());
+    if (pkg->GetResType().length() > strlen(kGadgetPrefix) &&
+        !pkg->GetResType().compare(0, strlen(kGadgetPrefix), kGadgetPrefix)) {
+      gadget_pkgids_.insert(pkg->GetPkgId());
+      gadget_paths_.emplace_back(pkg->GetRootPath() + ALLOWED_SUFFIX);
+    }
+
     if (pkg->IsLib()) {
       allowed_lib_paths_.emplace_back(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()) {
       global_lib_paths_.emplace_back(pkg->GetRootPath() + GLOBAL_SUFFIX + "/" +
                                      pkg->GetResType());
@@ -125,10 +122,6 @@ int ResMountPackageInfo::GetMountPackageInfo(
   return 0;
 }
 
-const std::set<std::string>& ResMountPackageInfo::GetPkgIds() const {
-  return pkgids_;
-}
-
 const std::vector<std::string>& ResMountPackageInfo::GetAllowedPaths() const {
   return allowed_paths_;
 }
index 405f2ac0d6180d8730c8fb6b9212c3436e22f547..e6a4ba78c8670b74fdd2c44607f37433e071e71a 100644 (file)
@@ -36,7 +36,6 @@ class ResMountPackageInfo {
   static int GetMountPackageInfo(const std::string& appid, uid_t uid,
                                  std::optional<ResMountPackageInfo>* info);
 
-  const std::set<std::string>& GetPkgIds() const;
   const std::vector<std::string>& GetAllowedPaths() const;
   const std::vector<std::string>& GetGlobalPaths() const;
   const std::vector<std::string>& GetAllowedLibPaths() const;
@@ -45,7 +44,6 @@ class ResMountPackageInfo {
   const std::vector<std::string>& GetGadgetPaths() const;
 
  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_;