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

Commit 65cc165e authored by Josh Gao's avatar Josh Gao Committed by android-build-merger
Browse files

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

am: 8523a7af

Change-Id: Ia15afae2be0bbebe451b8a3ae82dead8062963d1
parents b73020d2 8523a7af
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";
}