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

am: afa67f3d34

Change-Id: I2b3afb4acb9038a2d33ecf42bbbcc8c5d754ab5f
This commit is contained in:
Tim Murray
2016-07-16 19:25:37 +00:00
committed by android-build-merger

View File

@@ -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);
}
}
}