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

Commit afa67f3d authored by Tim Murray's avatar Tim Murray Committed by Android (Google) Code Review
Browse files

Merge "Make sure StrictMode allows disk reads when calling isThreadInProcess." into nyc-mr1-dev

parents c3829f52 9bc12a83
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1263,6 +1263,7 @@ public class Process {
     * @hide
     */
    public static final boolean isThreadInProcess(int tid, int pid) {
        StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
        try {
            if (Os.access("/proc/" + tid + "/task/" + pid, OsConstants.F_OK)) {
                return true;
@@ -1271,6 +1272,9 @@ public class Process {
            }
        } catch (Exception e) {
            return false;
        } finally {
            StrictMode.setThreadPolicy(oldPolicy);
        }

    }
}