Remove adding resource pakcage IDs to bundle object
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 25 Jan 2024 06:54:27 +0000 (15:54 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 5 Feb 2024 09:58:20 +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 a844cebb2a9ef0f6f5eb90245da64a8fa372a596..f350564a23a289c231fa7ab3d5624e7fcb2ade05 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 bfb0f154474ef22b15f35ffcb46c8865eca9b829..88be6132516872fb8accd3aef2190f4e4ada7f0c 100644 (file)
@@ -34,19 +34,16 @@ 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());
-    allowed_paths_.emplace_back(pkg->GetRootPath() + ALLOWED_SUFFIX);
-
-    if (pkg->GetResType().length() < strlen(kGadgetPrefix)) continue;
-
-    if (!pkg->GetResType().compare(0, strlen(kGadgetPrefix), kGadgetPrefix)) {
+    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);
     }
+
+    allowed_paths_.emplace_back(pkg->GetRootPath() + ALLOWED_SUFFIX);
   }
 
   for (const auto& pkg : global_packages) {
-    pkgids_.insert(pkg->GetPkgId());
     global_paths_.emplace_back(pkg->GetRootPath() + GLOBAL_SUFFIX);
   }
 }
@@ -115,10 +112,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 c9548b5d0553be0ad4fbd32929a746436efd7142..e4d6ca7fa86bcd57bbcddacc2c2b3fac0c4c3545 100644 (file)
@@ -35,16 +35,12 @@ 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;
-  const std::vector<std::string>& GetGlobalLibPaths() const;
   const std::set<std::string>& GetGadgetPkgIds() const;
   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::set<std::string> gadget_pkgids_;