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

Commit 67bfa8ac authored by Zimuzo's avatar Zimuzo Committed by android-build-merger
Browse files

Merge "Set system property if 'updatable' process crashes too frequently"

am: 97212d36

Change-Id: I8d758b491a9bbb548f69c1e31f28d13533051df7
parents 6061aef3 97212d36
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -367,12 +367,19 @@ void Service::Reap(const siginfo_t& siginfo) {
        return;
    }

    // If we crash > 4 times in 4 minutes, reboot into bootloader.
    // If we crash > 4 times in 4 minutes, reboot into bootloader or set crashing property
    boot_clock::time_point now = boot_clock::now();
    if ((flags_ & SVC_CRITICAL) && !(flags_ & SVC_RESTART)) {
    if (((flags_ & SVC_CRITICAL) || classnames_.count("updatable")) && !(flags_ & SVC_RESTART)) {
        if (now < time_crashed_ + 4min) {
            if (++crash_count_ > 4) {
                if (flags_ & SVC_CRITICAL) {
                    // Aborts into bootloader
                    LOG(FATAL) << "critical process '" << name_ << "' exited 4 times in 4 minutes";
                } else {
                    LOG(ERROR) << "updatable process '" << name_ << "' exited 4 times in 4 minutes";
                    // Notifies update_verifier and apexd
                    property_set("ro.init.updatable_crashing", "1");
                }
            }
        } else {
            time_crashed_ = now;