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

Commit 8523a7af authored by Josh Gao's avatar Josh Gao Committed by Android (Google) Code Review
Browse files

Merge "Update IsZygote to return true for USAPs." into qt-dev

parents c6af5302 33e622a5
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";
}