Fix a bug about app control action 95/315095/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 25 Jul 2024 04:27:16 +0000 (13:27 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 25 Jul 2024 04:30:13 +0000 (13:30 +0900)
If the mime type is not "NULL" and the sub type of the mime type is not "%",
the mime type of the argument should be checked with mimetype + "/*" value.

Change-Id: I34f77a0337a52372b1ed77771c6956641c815f6d
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
tizen-cpp/app-core-cpp/app_control_info_private.cc

index e0b986fdb12ecc8c7ee4cce01854de028ad0350a..5cd6283b57ed9667bd1966c86a34a3ec1a335000 100644 (file)
@@ -159,15 +159,17 @@ void AppControlInfo::SetUri(std::string uri) { uri_ = std::move(uri); }
 bool AppControlInfo::Match(const AppControlInfo& info) const {
   if (info.GetOperation() != GetOperation()) return false;
 
-  if (info.GetUri() == GetUri() && info.GetMime() == GetMime()) return true;
+  if (info.GetUri() != GetUri()) return false;
 
-  if (info.GetUri() == GetUri()) {
-    if (info.GetMime() == "NULL" && info.GetMimeSubtype() == "%") {
+  if (info.GetMime() == GetMime()) return true;
+
+  if (info.GetMime() != "NULL") {
+    if (info.GetMimeSubtype() != "%") {
       std::string mime = info.GetMimeType() + "/*";
       if (GetMime() == mime) return true;
     }
 
-    if (info.GetMime() == "NULL" && info.GetMimeType() == "%")
+    if (info.GetMimeType() != "%")
       if (GetMime() == "*/*") return true;
   }