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

Commit c788771d authored by Daniel Norman's avatar Daniel Norman
Browse files

Adds new property for service name -> PID.

Bug: 138114550
Test: used in vts_ibase_test
Change-Id: Id21b81aa09b8597d17ad0a132ddd7749fe1182e9
parent d19c5a50
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -165,6 +165,15 @@ void Service::NotifyStateChange(const std::string& new_state) const {
            property_set(boottime_property, std::to_string(start_ns));
        }
    }

    // init.svc_debug_pid.* properties are only for tests, and should not be used
    // on device for security checks.
    std::string pid_property = "init.svc_debug_pid." + name_;
    if (new_state == "running") {
        property_set(pid_property, std::to_string(pid_));
    } else if (new_state == "stopped") {
        property_set(pid_property, "");
    }
}

void Service::KillProcessGroup(int signal) {