summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmds/statsd/src/guardrail/StatsdStats.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmds/statsd/src/guardrail/StatsdStats.cpp b/cmds/statsd/src/guardrail/StatsdStats.cpp
index a836bd14c012..936a8751fd1d 100644
--- a/cmds/statsd/src/guardrail/StatsdStats.cpp
+++ b/cmds/statsd/src/guardrail/StatsdStats.cpp
@@ -449,9 +449,12 @@ void StatsdStats::notePullExceedMaxDelay(int pullAtomId) {
void StatsdStats::noteAtomLogged(int atomId, int32_t timeSec) {
lock_guard<std::mutex> lock(mLock);
- if (atomId <= android::util::kMaxPushedAtomId) {
+ if (atomId >= 0 && atomId <= android::util::kMaxPushedAtomId) {
mPushedAtomStats[atomId]++;
} else {
+ if (atomId < 0) {
+ android_errorWriteLog(0x534e4554, "187957589");
+ }
if (mNonPlatformPushedAtomStats.size() < kMaxNonPlatformPushedAtoms) {
mNonPlatformPushedAtomStats[atomId]++;
}