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

Commit 62547293 authored by Tim Murray's avatar Tim Murray Committed by android-build-merger
Browse files

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

am: afa67f3d

Change-Id: I2b3afb4acb9038a2d33ecf42bbbcc8c5d754ab5f
parents 6a9f651b afa67f3d
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);
        }

    }
}