diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-02-02 22:49:33 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-02-02 22:49:33 +0000 |
commit | 64eead096a4af38f33357cf109225dac463788c6 (patch) | |
tree | 0832182584e6cef6347a0268e5cfea1aa7ee47ab /statsd/src/matchers/SimpleAtomMatchingTracker.cpp | |
parent | 5c1c48fe8cd99076df016e78fece7d1a30cba376 (diff) | |
parent | fe94a87a6437fe218c8e0dc58aa608ce197f2f68 (diff) | |
download | StatsD-64eead096a4af38f33357cf109225dac463788c6.tar.gz |
Snap for 9556825 from fe94a87a6437fe218c8e0dc58aa608ce197f2f68 to mainline-adservices-releaseaml_ads_331611190
Change-Id: Ibbe245821d0de8caf3f1ac3b6b9f3c9248240c55
Diffstat (limited to 'statsd/src/matchers/SimpleAtomMatchingTracker.cpp')
-rw-r--r-- | statsd/src/matchers/SimpleAtomMatchingTracker.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/statsd/src/matchers/SimpleAtomMatchingTracker.cpp b/statsd/src/matchers/SimpleAtomMatchingTracker.cpp index 76bd4761..a0e30b24 100644 --- a/statsd/src/matchers/SimpleAtomMatchingTracker.cpp +++ b/statsd/src/matchers/SimpleAtomMatchingTracker.cpp @@ -42,20 +42,28 @@ SimpleAtomMatchingTracker::SimpleAtomMatchingTracker(const int64_t& id, const in SimpleAtomMatchingTracker::~SimpleAtomMatchingTracker() { } -bool SimpleAtomMatchingTracker::init(const vector<AtomMatcher>& allAtomMatchers, - const vector<sp<AtomMatchingTracker>>& allAtomMatchingTrackers, - const unordered_map<int64_t, int>& matcherMap, - vector<bool>& stack) { +optional<InvalidConfigReason> SimpleAtomMatchingTracker::init( + const vector<AtomMatcher>& allAtomMatchers, + const vector<sp<AtomMatchingTracker>>& allAtomMatchingTrackers, + const unordered_map<int64_t, int>& matcherMap, vector<bool>& stack) { // no need to do anything. - return mInitialized; + if (!mInitialized) { + return createInvalidConfigReasonWithMatcher( + INVALID_CONFIG_REASON_MATCHER_TRACKER_NOT_INITIALIZED, mId); + } + return nullopt; } -bool SimpleAtomMatchingTracker::onConfigUpdated( +optional<InvalidConfigReason> SimpleAtomMatchingTracker::onConfigUpdated( const AtomMatcher& matcher, const int index, const unordered_map<int64_t, int>& atomMatchingTrackerMap) { mIndex = index; // Do not need to update mMatcher since the matcher must be identical across the update. - return mInitialized; + if (!mInitialized) { + return createInvalidConfigReasonWithMatcher( + INVALID_CONFIG_REASON_MATCHER_TRACKER_NOT_INITIALIZED, mId); + } + return nullopt; } void SimpleAtomMatchingTracker::onLogEvent( |