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

Commit 33e622a5 authored by Josh Gao's avatar Josh Gao
Browse files

Update IsZygote to return true for USAPs.

Bug: http://b/132912216
Test: treehugger
Change-Id: I677d7e22e8d78b6dd92f0c35e9493acc6524c0e0
parent df23713d
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -110,13 +110,15 @@ std::set<int> get_interesting_hal_pids() {
}

bool IsZygote(int pid) {
    static const std::string kZygotePrefix = "zygote";

    std::string cmdline;
    if (!android::base::ReadFileToString(android::base::StringPrintf("/proc/%d/cmdline", pid),
                                         &cmdline)) {
        return true;
    }

    return (cmdline.find(kZygotePrefix) == 0);
    // cmdline has embedded nulls; only consider argv[0].
    cmdline = std::string(cmdline.c_str());

    return cmdline == "zygote" || cmdline == "zygote64" || cmdline == "usap32" ||
            cmdline == "usap64";
}