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

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

Merge \\"Make sure StrictMode allows disk reads when calling...

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

Change-Id: Idc39bd967dfc45c9d66aaf5f28e1012c4c15bd78
parents 8024bf72 62547293
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -912,6 +912,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;
@@ -920,6 +921,9 @@ public class Process {
            }
        } catch (Exception e) {
            return false;
        } finally {
            StrictMode.setThreadPolicy(oldPolicy);
        }

    }
}