Add package paremeter to application filter 98/289298/1
authorilho kim <ilho159.kim@samsung.com>
Mon, 6 Mar 2023 04:34:47 +0000 (13:34 +0900)
committerilho kim <ilho159.kim@samsung.com>
Mon, 6 Mar 2023 04:34:47 +0000 (13:34 +0900)
Package information of the application may be required
in the application filter

Change-Id: I1386eb75cd30f939eef253621b13300904398b1a
Signed-off-by: ilho kim <ilho159.kim@samsung.com>
57 files changed:
src/server/database/db_handle_provider.cc
src/server/database/db_handle_provider.hh
src/server/filter_checker/app_filter_checker/app_disable_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/app_disable_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/appid_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/appid_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/auto_restart_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/auto_restart_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/category_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/category_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/check_storage_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/check_storage_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/component_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/component_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/default_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/default_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/exec_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/exec_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/hw_acceleration_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/hw_acceleration_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/icon_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/icon_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/launch_condition_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/launch_condition_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/mime_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/mime_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/multiple_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/multiple_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/nodisplay_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/nodisplay_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/onboot_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/onboot_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/operation_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/operation_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/pkg_disable_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/pkg_disable_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/pkgid_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/pkgid_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/privilege_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/privilege_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/screen_reader_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/screen_reader_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/storage_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/storage_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/support_disable_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/support_disable_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/support_mode_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/support_mode_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/task_manage_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/task_manage_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/type_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/type_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/ui_gadget_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/ui_gadget_app_filter_checker.hh
src/server/filter_checker/app_filter_checker/uri_app_filter_checker.cc
src/server/filter_checker/app_filter_checker/uri_app_filter_checker.hh
src/server/filter_checker/app_filter_checker_base.hh

index 78bc332..258862e 100644 (file)
@@ -483,22 +483,32 @@ void DBHandleProvider::AddPackage(std::string package,
 }
 
 inline bool CheckAppFilters(pkgmgrinfo_filter_x* filter,
-  const std::shared_ptr<application_x>& info,
+  const std::shared_ptr<application_x>& app_info,
+  const std::shared_ptr<package_x>& pkg_info,
   const std::unordered_map<std::string, std::string>& metadata_map) {
   for (auto* it = filter->list; it != nullptr; it = g_slist_next(it)) {
     auto node = reinterpret_cast<pkgmgrinfo_node_x*>(it->data);
     auto* checker = FilterCheckerProvider::GetInst().
         GetAppFilterChecker(node->prop);
-    if (!checker->CheckFilter(node, info.get()))
+    if (!checker->CheckFilter(node, app_info.get(), pkg_info.get()))
       return false;
   }
 
   bool pass = true;
   if (!metadata_map.empty())
-    pass = CheckMetadataFilter(info->metadata, metadata_map);
+    pass = CheckMetadataFilter(app_info->metadata, metadata_map);
   return pass;
 }
 
+std::shared_ptr<package_x> DBHandleProvider::GetPackageByApp(
+    const char* appid) {
+  auto it = pkg_map_.find(appid);
+  if (it == pkg_map_.end())
+    return nullptr;
+
+  return it->second;
+}
+
 std::vector<std::shared_ptr<application_x>> DBHandleProvider::GetApplications(
     pid_t pid, pkgmgrinfo_filter_x* filter,
     const std::string& app) {
@@ -523,13 +533,15 @@ std::vector<std::shared_ptr<application_x>> DBHandleProvider::GetApplications(
 
   if (app.empty()) {
     for (auto& info : app_map_) {
-      if (CheckAppFilters(filter, info.second, metadata_map))
+      if (CheckAppFilters(filter, info.second,
+          GetPackageByApp(info.second->package), metadata_map))
         ret.push_back(info.second);
     }
   } else {
     auto map_it = app_map_.find(app);
     if (map_it != app_map_.end() &&
-        CheckAppFilters(filter, map_it->second, metadata_map))
+        CheckAppFilters(filter, map_it->second,
+            GetPackageByApp(map_it->second->package), metadata_map))
       ret.push_back(map_it->second);
   }
 
index 324f23c..e8ec9ee 100644 (file)
@@ -81,6 +81,7 @@ class EXPORT_API DBHandleProvider {
   void AddApplication(std::string app, std::shared_ptr<application_x> info);
   void InsertPID(pid_t pid);
   bool ErasePID(pid_t pid);
+  std::shared_ptr<package_x> GetPackageByApp(const char* appid);
 
  private:
   static std::unordered_map<uid_t,
index bf7619f..c01f04c 100644 (file)
@@ -25,9 +25,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool AppDisableAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                             application_x* info) {
-  return (node->value != nullptr && info->is_disabled != nullptr &&
-          strcasecmp(node->value, info->is_disabled) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->is_disabled != nullptr &&
+          strcasecmp(node->value, app_info->is_disabled) == 0);
 }
 
 }  // namespace database
index dae22bf..0a932d1 100644 (file)
@@ -29,7 +29,8 @@ class AppDisableAppFilterChecker: public IAppFilterChecker {
  public:
   AppDisableAppFilterChecker() = default;
   ~AppDisableAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index 98b7b89..d3440f3 100644 (file)
@@ -23,9 +23,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool AppIdAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                        application_x* info) {
-  return (node->value != nullptr && info->appid != nullptr &&
-          strcmp(node->value, info->appid) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->appid != nullptr &&
+          strcmp(node->value, app_info->appid) == 0);
 }
 
 }  // namespace database
index 83d0ada..374d20b 100644 (file)
@@ -29,7 +29,8 @@ class AppIdAppFilterChecker: public IAppFilterChecker {
  public:
   AppIdAppFilterChecker() = default;
   ~AppIdAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index 2f45690..558e243 100644 (file)
@@ -20,9 +20,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool AutoRestartAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                             application_x* info) {
-  return (node->value != nullptr && info->autorestart != nullptr &&
-          strcasecmp(node->value, info->autorestart) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->autorestart != nullptr &&
+          strcasecmp(node->value, app_info->autorestart) == 0);
 }
 
 }  // namespace database
index 9f58114..55d8120 100644 (file)
@@ -29,7 +29,8 @@ class AutoRestartAppFilterChecker: public IAppFilterChecker {
  public:
   AutoRestartAppFilterChecker() = default;
   ~AutoRestartAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index c84737a..55d5e53 100644 (file)
@@ -25,8 +25,8 @@ namespace pkgmgr_server {
 namespace database {
 
 bool CategoryAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                           application_x* info) {
-  for (auto* it = info->category; it != nullptr; it = g_list_next(it)) {
+    application_x* app_info, package_x* pkg_info) {
+  for (auto* it = app_info->category; it != nullptr; it = g_list_next(it)) {
     char* value = reinterpret_cast<char*>(it->data);
     if (value != nullptr && strcmp(value, node->value) == 0) return true;
   }
index 155b5a3..326e0b1 100644 (file)
@@ -29,7 +29,8 @@ class CategoryAppFilterChecker: public IAppFilterChecker {
  public:
   CategoryAppFilterChecker() = default;
   ~CategoryAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index 8878aab..4101bf8 100644 (file)
@@ -20,9 +20,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool CheckStorageAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-    application_x* info) {
+    application_x* app_info, package_x* pkg_info) {
   return (node->value == nullptr || strcasecmp(node->value, "true") != 0 ||
-      __appinfo_check_installed_storage(info) == PMINFO_R_OK);
+      __appinfo_check_installed_storage(app_info) == PMINFO_R_OK);
 }
 
 }  // namespace database
index b075c81..f21a131 100644 (file)
@@ -29,7 +29,8 @@ class CheckStorageAppFilterChecker: public IAppFilterChecker {
  public:
   CheckStorageAppFilterChecker() = default;
   ~CheckStorageAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index 9352fbd..7de9fec 100644 (file)
@@ -23,9 +23,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool ComponentAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                           application_x* info) {
-  return (node->value != nullptr && info->component != nullptr &&
-          strcmp(node->value, info->component) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->component != nullptr &&
+          strcmp(node->value, app_info->component) == 0);
 }
 
 }  // namespace database
index 80ac0c7..68ac2b9 100644 (file)
@@ -29,7 +29,8 @@ class ComponentAppFilterChecker: public IAppFilterChecker {
  public:
   ComponentAppFilterChecker() = default;
   ~ComponentAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index 16b74ed..04c3b70 100644 (file)
@@ -23,7 +23,7 @@ namespace pkgmgr_server {
 namespace database {
 
 bool DefaultAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                          application_x* info) {
+    application_x* app_info, package_x* pkg_info) {
   return true;
 }
 
index 490273a..7d3f377 100644 (file)
@@ -29,7 +29,8 @@ class DefaultAppFilterChecker: public IAppFilterChecker {
  public:
   DefaultAppFilterChecker() = default;
   ~DefaultAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index 184d960..541bfe7 100644 (file)
@@ -23,9 +23,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool ExecAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                       application_x* info) {
-  return (node->value != nullptr && info->exec != nullptr &&
-          strcmp(node->value, info->exec) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->exec != nullptr &&
+          strcmp(node->value, app_info->exec) == 0);
 }
 
 }  // namespace database
index ae4593d..17b394c 100644 (file)
@@ -29,7 +29,8 @@ class ExecAppFilterChecker: public IAppFilterChecker {
  public:
   ExecAppFilterChecker() = default;
   ~ExecAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index f6756fb..256d5e9 100644 (file)
@@ -20,9 +20,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool HWAccelerationAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                             application_x* info) {
-  return (node->value != nullptr && info->hwacceleration != nullptr &&
-          strcmp(node->value, info->hwacceleration) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->hwacceleration != nullptr &&
+          strcmp(node->value, app_info->hwacceleration) == 0);
 }
 
 }  // namespace database
index 931ce00..34b1159 100644 (file)
@@ -29,7 +29,8 @@ class HWAccelerationAppFilterChecker: public IAppFilterChecker {
  public:
   HWAccelerationAppFilterChecker() = default;
   ~HWAccelerationAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index f04fc29..362a63e 100644 (file)
@@ -23,11 +23,11 @@ namespace pkgmgr_server {
 namespace database {
 
 bool IconAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                             application_x* info) {
+    application_x* app_info, package_x* pkg_info) {
   if (node->value == nullptr)
     return false;
 
-  for (auto* it = info->icon; it; it = g_list_next(it)) {
+  for (auto* it = app_info->icon; it; it = g_list_next(it)) {
     auto path = reinterpret_cast<icon_x*>(it->data)->text;
     if (path != nullptr && strcmp(path, node->value) == 0)
       return true;
index 9f83617..c001f8d 100644 (file)
@@ -29,7 +29,8 @@ class IconAppFilterChecker: public IAppFilterChecker {
  public:
   IconAppFilterChecker() = default;
   ~IconAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index 17981ba..5bb37af 100644 (file)
@@ -20,9 +20,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool LaunchConditionAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                             application_x* info) {
-  return (node->value != nullptr && info->launchcondition != nullptr &&
-          strcmp(node->value, info->launchcondition) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->launchcondition != nullptr &&
+          strcmp(node->value, app_info->launchcondition) == 0);
 }
 
 }  // namespace database
index 57c9746..d21e790 100644 (file)
@@ -29,7 +29,8 @@ class LaunchConditionAppFilterChecker: public IAppFilterChecker {
  public:
   LaunchConditionAppFilterChecker() = default;
   ~LaunchConditionAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index d296ab0..2dd8237 100644 (file)
@@ -22,10 +22,10 @@ namespace pkgmgr_server {
 namespace database {
 
 bool MimeAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                            application_x* info) {
+    application_x* app_info, package_x* pkg_info) {
   if (node->value == nullptr)
     return false;
-  for (auto* it = info->appcontrol; it != nullptr; it = g_list_next(it)) {
+  for (auto* it = app_info->appcontrol; it != nullptr; it = g_list_next(it)) {
     char* value = reinterpret_cast<appcontrol_x*>(it->data)->mime;
     if (value != nullptr && strcmp(value, node->value) == 0)
       return true;
index adfef2f..8fef5ed 100644 (file)
@@ -29,7 +29,8 @@ class MimeAppFilterChecker: public IAppFilterChecker {
  public:
   MimeAppFilterChecker() = default;
   ~MimeAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index a54da86..ee77f16 100644 (file)
@@ -20,9 +20,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool MultipleAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                            application_x* info) {
-  return (node->value != nullptr && info->multiple != nullptr &&
-          strcasecmp(node->value, info->multiple) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->multiple != nullptr &&
+          strcasecmp(node->value, app_info->multiple) == 0);
 }
 
 }  // namespace database
index 5462e87..4542014 100644 (file)
@@ -29,7 +29,8 @@ class MultipleAppFilterChecker: public IAppFilterChecker {
  public:
   MultipleAppFilterChecker() = default;
   ~MultipleAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index dfdcdbf..9f88875 100644 (file)
@@ -23,9 +23,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool NoDisplayAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                            application_x* info) {
-  return (node->value != nullptr && info->nodisplay != nullptr &&
-          strcasecmp(node->value, info->nodisplay) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->nodisplay != nullptr &&
+          strcasecmp(node->value, app_info->nodisplay) == 0);
 }
 
 }  // namespace database
index ee17527..5e0ef15 100644 (file)
@@ -29,7 +29,8 @@ class NoDisplayAppFilterChecker: public IAppFilterChecker {
  public:
   NoDisplayAppFilterChecker() = default;
   ~NoDisplayAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index 0ad6559..baa916d 100644 (file)
@@ -23,9 +23,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool OnBootAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                            application_x* info) {
-  return (node->value != nullptr && info->onboot != nullptr &&
-          strcasecmp(node->value, info->onboot) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->onboot != nullptr &&
+          strcasecmp(node->value, app_info->onboot) == 0);
 }
 
 }  // namespace database
index 83a4965..f4988f1 100644 (file)
@@ -29,7 +29,8 @@ class OnBootAppFilterChecker: public IAppFilterChecker {
  public:
   OnBootAppFilterChecker() = default;
   ~OnBootAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index 289188a..8ccdaf5 100644 (file)
@@ -22,8 +22,8 @@ namespace pkgmgr_server {
 namespace database {
 
 bool OperationAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                            application_x* info) {
-  for (auto* it = info->appcontrol; it != nullptr; it = g_list_next(it)) {
+    application_x* app_info, package_x* pkg_info) {
+  for (auto* it = app_info->appcontrol; it != nullptr; it = g_list_next(it)) {
     char* value = reinterpret_cast<appcontrol_x*>(it->data)->operation;
     if (value != nullptr && strcmp(value, node->value) == 0)
       return true;
index 0c8f9f1..56602cc 100644 (file)
@@ -29,7 +29,8 @@ class OperationAppFilterChecker: public IAppFilterChecker {
  public:
   OperationAppFilterChecker() = default;
   ~OperationAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index bd9d116..96a042b 100644 (file)
@@ -23,7 +23,7 @@ namespace pkgmgr_server {
 namespace database {
 
 bool PkgDisableAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                             application_x* info) {
+    application_x* app_info, package_x* pkg_info) {
   return (node->value != nullptr && strcasecmp(node->value, "false") == 0);
 }
 
index 7fd6902..d081ead 100644 (file)
@@ -29,7 +29,8 @@ class PkgDisableAppFilterChecker: public IAppFilterChecker {
  public:
   PkgDisableAppFilterChecker() = default;
   ~PkgDisableAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index 08d2093..0d5bd96 100644 (file)
@@ -23,9 +23,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool PkgIdAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                            application_x* info) {
-  return (node->value != nullptr && info->package != nullptr &&
-          strcmp(node->value, info->package) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->package != nullptr &&
+          strcmp(node->value, app_info->package) == 0);
 }
 
 }  // namespace database
index 1f35348..f49116d 100644 (file)
@@ -29,7 +29,8 @@ class PkgIdAppFilterChecker: public IAppFilterChecker {
  public:
   PkgIdAppFilterChecker() = default;
   ~PkgIdAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index 916c8d6..2db2a87 100644 (file)
@@ -22,8 +22,8 @@ namespace pkgmgr_server {
 namespace database {
 
 bool PrivilegeAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                            application_x* info) {
-  for (auto* it = info->privileges; it != nullptr; it = g_list_next(it)) {
+    application_x* app_info, package_x* pkg_info) {
+  for (auto* it = app_info->privileges; it != nullptr; it = g_list_next(it)) {
     char* value = reinterpret_cast<privilege_x*>(it->data)->value;
     if (value != nullptr && strcmp(value, node->value) == 0) return true;
   }
index f946798..10d5ce4 100644 (file)
@@ -29,7 +29,8 @@ class PrivilegeAppFilterChecker: public IAppFilterChecker {
  public:
   PrivilegeAppFilterChecker() = default;
   ~PrivilegeAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index 6536c02..2ce7ed6 100644 (file)
@@ -20,9 +20,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool ScreenReaderAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                             application_x* info) {
-  return (node->value != nullptr && info->screenreader != nullptr &&
-          strcmp(node->value, info->screenreader) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->screenreader != nullptr &&
+          strcmp(node->value, app_info->screenreader) == 0);
 }
 
 }  // namespace database
index 2ddf2f3..f005668 100644 (file)
@@ -29,7 +29,8 @@ class ScreenReaderAppFilterChecker: public IAppFilterChecker {
  public:
   ScreenReaderAppFilterChecker() = default;
   ~ScreenReaderAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index e968bfb..9f9c39f 100644 (file)
@@ -23,9 +23,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool StorageAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                             application_x* info) {
-  return (node->value != nullptr && info->installed_storage != nullptr &&
-          strcasecmp(node->value, info->installed_storage) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->installed_storage != nullptr &&
+          strcasecmp(node->value, app_info->installed_storage) == 0);
 }
 
 }  // namespace database
index cd56240..002c156 100644 (file)
@@ -29,7 +29,8 @@ class StorageAppFilterChecker: public IAppFilterChecker {
  public:
   StorageAppFilterChecker() = default;
   ~StorageAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index 5f90402..4ee36ad 100644 (file)
@@ -20,9 +20,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool SupportDisableAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                             application_x* info) {
-  return (node->value != nullptr && info->support_disable != nullptr &&
-          strcasecmp(node->value, info->ui_gadget) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->support_disable != nullptr &&
+          strcasecmp(node->value, app_info->ui_gadget) == 0);
 }
 
 }  // namespace database
index 6481e1c..d699eae 100644 (file)
@@ -29,7 +29,8 @@ class SupportDisableAppFilterChecker: public IAppFilterChecker {
  public:
   SupportDisableAppFilterChecker() = default;
   ~SupportDisableAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index a303d11..85b9dd5 100644 (file)
@@ -20,9 +20,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool SupportModeAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                             application_x* info) {
-  return (node->value != nullptr && info->support_mode != nullptr &&
-          strcmp(node->value, info->support_mode) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->support_mode != nullptr &&
+          strcmp(node->value, app_info->support_mode) == 0);
 }
 
 }  // namespace database
index 380b89a..b8cb47e 100644 (file)
@@ -29,7 +29,8 @@ class SupportModeAppFilterChecker: public IAppFilterChecker {
  public:
   SupportModeAppFilterChecker() = default;
   ~SupportModeAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index 501db60..2f096b6 100644 (file)
@@ -20,9 +20,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool TaskManageAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                             application_x* info) {
-  return (node->value != nullptr && info->taskmanage != nullptr &&
-          strcasecmp(node->value, info->taskmanage) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->taskmanage != nullptr &&
+          strcasecmp(node->value, app_info->taskmanage) == 0);
 }
 
 }  // namespace database
index 469936a..381fb92 100644 (file)
@@ -29,7 +29,8 @@ class TaskManageAppFilterChecker: public IAppFilterChecker {
  public:
   TaskManageAppFilterChecker() = default;
   ~TaskManageAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index 76e5e2f..ec80185 100644 (file)
@@ -23,9 +23,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool TypeAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                            application_x* info) {
-  return (node->value != nullptr && info->type != nullptr &&
-          strcmp(node->value, info->type) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->type != nullptr &&
+          strcmp(node->value, app_info->type) == 0);
 }
 
 }  // namespace database
index 951d7dd..db0649e 100644 (file)
@@ -29,7 +29,8 @@ class TypeAppFilterChecker: public IAppFilterChecker {
  public:
   TypeAppFilterChecker() = default;
   ~TypeAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index bf6ece0..dbbc134 100644 (file)
@@ -20,9 +20,9 @@ namespace pkgmgr_server {
 namespace database {
 
 bool UIGadgetAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                             application_x* info) {
-  return (node->value != nullptr && info->ui_gadget != nullptr &&
-          strcmp(node->value, info->ui_gadget) == 0);
+    application_x* app_info, package_x* pkg_info) {
+  return (node->value != nullptr && app_info->ui_gadget != nullptr &&
+          strcmp(node->value, app_info->ui_gadget) == 0);
 }
 
 }  // namespace database
index 4fb2500..868d422 100644 (file)
@@ -29,7 +29,8 @@ class UIGadgetAppFilterChecker: public IAppFilterChecker {
  public:
   UIGadgetAppFilterChecker() = default;
   ~UIGadgetAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index 6d23091..de913e3 100644 (file)
@@ -22,10 +22,10 @@ namespace pkgmgr_server {
 namespace database {
 
 bool URIAppFilterChecker::CheckFilter(pkgmgrinfo_node_x* node,
-                                            application_x* info) {
+    application_x* app_info, package_x* pkg_info) {
   if (node->value == nullptr)
     return false;
-  for (auto* it = info->appcontrol; it != nullptr; it = g_list_next(it)) {
+  for (auto* it = app_info->appcontrol; it != nullptr; it = g_list_next(it)) {
     char* value = reinterpret_cast<appcontrol_x*>(it->data)->uri;
     if (value != nullptr && strcmp(value, node->value) == 0)
       return true;
index 44783b5..b6fd70b 100644 (file)
@@ -29,7 +29,8 @@ class URIAppFilterChecker: public IAppFilterChecker {
  public:
   URIAppFilterChecker() = default;
   ~URIAppFilterChecker() = default;
-  bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) override;
+  bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) override;
 };
 
 }  // namespace database
index ae00f9d..f575272 100644 (file)
@@ -27,7 +27,8 @@ class IAppFilterChecker {
  public:
   IAppFilterChecker() = default;
   virtual ~IAppFilterChecker() = default;
-  virtual bool CheckFilter(pkgmgrinfo_node_x* node, application_x* info) = 0;
+  virtual bool CheckFilter(pkgmgrinfo_node_x* node,
+      application_x* app_info, package_x* pkg_info) = 0;
 };
 
 }  // namespace database