Statsd: ISOLATED_UID_CHANGED out of batterystats
Moves the calls to StatsLog.write for ISOLATED_UID_CHANGED to the
calling functions, rather than batterystatsimpl.
Bug: 80308558
Test: none?
Change-Id: I6fe389c536b2a456907c8a87fae61e9c3434004d
diff --git a/cmds/statsd/src/StatsLogProcessor.cpp b/cmds/statsd/src/StatsLogProcessor.cpp
index e7f1caf..1378ce5 100644
--- a/cmds/statsd/src/StatsLogProcessor.cpp
+++ b/cmds/statsd/src/StatsLogProcessor.cpp
@@ -152,7 +152,7 @@
if (is_create) {
mUidMap->assignIsolatedUid(isolated_uid, parent_uid);
} else {
- mUidMap->removeIsolatedUid(isolated_uid, parent_uid);
+ mUidMap->removeIsolatedUid(isolated_uid);
}
} else {
ALOGE("Failed to parse uid in the isolated uid change event.");
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto
index ab9c7e8..ca3786a 100644
--- a/cmds/statsd/src/atoms.proto
+++ b/cmds/statsd/src/atoms.proto
@@ -1484,6 +1484,7 @@
message IsolatedUidChanged {
// The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
// NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
+ // This field is ignored when event == REMOVED.
optional int32 parent_uid = 1;
optional int32 isolated_uid = 2;
diff --git a/cmds/statsd/src/packages/UidMap.cpp b/cmds/statsd/src/packages/UidMap.cpp
index fff909c..be94725 100644
--- a/cmds/statsd/src/packages/UidMap.cpp
+++ b/cmds/statsd/src/packages/UidMap.cpp
@@ -272,7 +272,7 @@
mIsolatedUidMap[isolatedUid] = parentUid;
}
-void UidMap::removeIsolatedUid(int isolatedUid, int parentUid) {
+void UidMap::removeIsolatedUid(int isolatedUid) {
lock_guard<mutex> lock(mIsolatedMutex);
auto it = mIsolatedUidMap.find(isolatedUid);
diff --git a/cmds/statsd/src/packages/UidMap.h b/cmds/statsd/src/packages/UidMap.h
index 5e42cd1..514eec7 100644
--- a/cmds/statsd/src/packages/UidMap.h
+++ b/cmds/statsd/src/packages/UidMap.h
@@ -119,7 +119,7 @@
void OnConfigRemoved(const ConfigKey& key);
void assignIsolatedUid(int isolatedUid, int parentUid);
- void removeIsolatedUid(int isolatedUid, int parentUid);
+ void removeIsolatedUid(int isolatedUid);
// Returns the host uid if it exists. Otherwise, returns the same uid that was passed-in.
virtual int getHostUidOrSelf(int uid) const;