Merge "logd: stop log spam when integrity enforcement is suppressed"

am: 9218477ae7

* commit '9218477ae7a3561f258e587b225cadfd73f0ed04':
  logd: stop log spam when integrity enforcement is suppressed
This commit is contained in:
Sami Tolvanen 2016-02-29 20:31:12 +00:00 committed by android-build-merger
commit 892cda4397

View file

@ -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;
}