Merge "ActivityManager: Allow DiskRead for wrap.sh determination" into oc-dev

This commit is contained in:
TreeHugger Robot
2017-03-28 23:17:58 +00:00
committed by Android (Google) Code Review

View File

@@ -3929,8 +3929,13 @@ public class ActivityManagerService extends IActivityManager.Stub
if ((app.info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) { if ((app.info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
// Debuggable apps may include a wrapper script with their library directory. // Debuggable apps may include a wrapper script with their library directory.
String wrapperFileName = app.info.nativeLibraryDir + "/wrap.sh"; String wrapperFileName = app.info.nativeLibraryDir + "/wrap.sh";
if (new File(wrapperFileName).exists()) { StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
invokeWith = "/system/bin/logwrapper " + wrapperFileName; try {
if (new File(wrapperFileName).exists()) {
invokeWith = "/system/bin/logwrapper " + wrapperFileName;
}
} finally {
StrictMode.setThreadPolicy(oldPolicy);
} }
} }