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

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
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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);
    }
}