Skip to content
Snippets Groups Projects
Commit 50f5bad0 authored by tsaichristine's avatar tsaichristine
Browse files

Fix partial reset function in StateTracker

Partial reset should notify all StateListeners of a state change similar
to the full reset function.

Test: bit statsd_test:*
Bug: 145838567
Change-Id: I5562b4db6f3e0be94385270d19b54f8934d8a85e
parent 98585a6c
No related branches found
No related tags found
No related merge requests found
......@@ -139,6 +139,13 @@ void StateTracker::handlePartialReset(const int64_t eventTimeNs,
const HashableDimensionKey& primaryKey) {
VLOG("StateTracker handle partial reset");
if (mStateMap.find(primaryKey) != mStateMap.end()) {
for (auto l : mListeners) {
auto sl = l.promote();
if (sl != nullptr) {
sl->onStateChanged(eventTimeNs, mAtomId, primaryKey,
mStateMap.find(primaryKey)->second.state, mDefaultState);
}
}
mStateMap.erase(primaryKey);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment