Add warning about multiple tests in one file am: 0c01919f91

Original change: https://android-review.googlesource.com/c/platform/system/logging/+/2939782

Change-Id: I751b1b3f8ebdcfd1d152abef8a974318a3f97bc5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/logd/LogStatistics.cpp b/logd/LogStatistics.cpp
index 5295495..173b733 100644
--- a/logd/LogStatistics.cpp
+++ b/logd/LogStatistics.cpp
@@ -111,21 +111,14 @@
 }
 
 void LogStatistics::AddTotal(log_id_t log_id, uint16_t size) {
-    if (!enable) {
-        return;
-    }
-
     auto lock = std::lock_guard{lock_};
+
     mSizesTotal[log_id] += size;
     SizesTotal += size;
     ++mElementsTotal[log_id];
 }
 
 void LogStatistics::Add(LogStatisticsElement element) {
-    if (!enable) {
-        return;
-    }
-
     auto lock = std::lock_guard{lock_};
 
     if (!track_total_size_) {
@@ -188,10 +181,6 @@
 }
 
 void LogStatistics::Subtract(LogStatisticsElement element) {
-    if (!enable) {
-        return;
-    }
-
     auto lock = std::lock_guard{lock_};
 
     if (!track_total_size_) {
@@ -242,10 +231,6 @@
 
 // caller must own and free character string
 const char* LogStatistics::UidToNameLocked(uid_t uid) const {
-    if (!enable) {
-        return strdup("logd");
-    }
-
     // Local hard coded favourites
     if (uid == AID_LOGD) {
         return strdup("auditd");
@@ -587,10 +572,6 @@
 }
 
 std::string LogStatistics::ReportInteresting() const {
-    if (!enable) {
-        return std::string("");
-    }
-
     auto lock = std::lock_guard{lock_};
 
     std::vector<std::string> items;
@@ -616,10 +597,6 @@
 }
 
 std::string LogStatistics::Format(uid_t uid, pid_t pid, unsigned int logMask) const {
-    if (!enable) {
-        return std::string("");
-    }
-
     auto lock = std::lock_guard{lock_};
 
     static const uint16_t spaces_total = 19;