Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit abda9340 authored by Sami Tolvanen's avatar Sami Tolvanen
Browse files

logd: stop log spam when integrity enforcement is suppressed

Bug: 27389331
Change-Id: I9f3bc21eb1b85b9fda4fa0a5c5b4da94e5e7cc1c
parent 50eb9b29
Loading
Loading
Loading
Loading
+11 −2
Original line number Original line Diff line number Diff line
@@ -99,11 +99,20 @@ std::string LogAudit::getProperty(const std::string& name)
}
}


void LogAudit::enforceIntegrity() {
void LogAudit::enforceIntegrity() {
    static bool loggedOnce;
    bool once = loggedOnce;

    loggedOnce = true;

    if (!AUDITD_ENFORCE_INTEGRITY) {
    if (!AUDITD_ENFORCE_INTEGRITY) {
        if (!once) {
            logToDmesg("integrity enforcement suppressed; not rebooting");
            logToDmesg("integrity enforcement suppressed; not rebooting");
        }
    } else if (rebootToSafeMode) {
    } else if (rebootToSafeMode) {
        if (getProperty("persist.sys.safemode") == "1") {
        if (getProperty("persist.sys.safemode") == "1") {
            if (!once) {
                logToDmesg("integrity enforcement suppressed; in safe mode");
                logToDmesg("integrity enforcement suppressed; in safe mode");
            }
            return;
            return;
        }
        }