Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16c8c6ab authored by Tej Singh's avatar Tej Singh
Browse files

Make matchesSimple return false if there is a parsing error

Previously, this would return true if there was an error getting
value from the logEvent. This is bad because it would match
if there was an error.

Test: ran unit tests and cts test
Change-Id: I83054c2a1b922ce374312e3091a8b668f6b89a8f
parent 1f272d89
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -117,6 +117,9 @@ bool matchesSimple(const SimpleAtomMatcher& simpleMatcher, const LogEvent& event
                    allMatched = false;
                    break;
                }
            } else {
                allMatched = false;
                break;
            }
        } else if (matcherCase == KeyValueMatcher::ValueMatcherCase::kEqInt ||
                   matcherCase == KeyValueMatcher::ValueMatcherCase::kLtInt ||
@@ -153,6 +156,9 @@ bool matchesSimple(const SimpleAtomMatcher& simpleMatcher, const LogEvent& event
                        break;
                    }
                }
            } else {
                allMatched = false;
                break;
            }
        } else if (matcherCase == KeyValueMatcher::ValueMatcherCase::kEqBool) {
            // Boolean fields
@@ -163,6 +169,9 @@ bool matchesSimple(const SimpleAtomMatcher& simpleMatcher, const LogEvent& event
                    allMatched = false;
                    break;
                }
            } else {
                allMatched = false;
                break;
            }
        } else if (matcherCase == KeyValueMatcher::ValueMatcherCase::kLtFloat ||
                   matcherCase == KeyValueMatcher::ValueMatcherCase::kGtFloat) {
@@ -181,6 +190,9 @@ bool matchesSimple(const SimpleAtomMatcher& simpleMatcher, const LogEvent& event
                        break;
                    }
                }
            } else {
                allMatched = false;
                break;
            }
        } else {
            // If value matcher is not present, assume that we match.