summaryrefslogtreecommitdiffstats
path: root/logd/LogAudit.cpp
diff options
context:
space:
mode:
authorSami Tolvanen <samitolvanen@google.com>2016-02-29 09:07:46 -0800
committerSami Tolvanen <samitolvanen@google.com>2016-02-29 12:08:39 -0800
commitabda9340e68d71c708e0ccd81909061b5162f065 (patch)
tree04fb11e82f0deb81983019b2f12298f1e855c937 /logd/LogAudit.cpp
parent50eb9b29db783b6bda724da0f021489e7ec7f25a (diff)
downloadcore-abda9340e68d71c708e0ccd81909061b5162f065.tar.gz
core-abda9340e68d71c708e0ccd81909061b5162f065.tar.bz2
core-abda9340e68d71c708e0ccd81909061b5162f065.zip
logd: stop log spam when integrity enforcement is suppressed
Bug: 27389331 Change-Id: I9f3bc21eb1b85b9fda4fa0a5c5b4da94e5e7cc1c
Diffstat (limited to 'logd/LogAudit.cpp')
-rw-r--r--logd/LogAudit.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/logd/LogAudit.cpp b/logd/LogAudit.cpp
index 230dd1125..9124bfdfc 100644
--- a/logd/LogAudit.cpp
+++ b/logd/LogAudit.cpp
@@ -99,11 +99,20 @@ std::string LogAudit::getProperty(const std::string& name)
}
void LogAudit::enforceIntegrity() {
+ static bool loggedOnce;
+ bool once = loggedOnce;
+
+ loggedOnce = true;
+
if (!AUDITD_ENFORCE_INTEGRITY) {
- logToDmesg("integrity enforcement suppressed; not rebooting");
+ if (!once) {
+ logToDmesg("integrity enforcement suppressed; not rebooting");
+ }
} else if (rebootToSafeMode) {
if (getProperty("persist.sys.safemode") == "1") {
- logToDmesg("integrity enforcement suppressed; in safe mode");
+ if (!once) {
+ logToDmesg("integrity enforcement suppressed; in safe mode");
+ }
return;
}