Merge "Allows disk reads when adding native paths to classloader" into pi-dev

am: 147ef6b1a4

Change-Id: I8d7e6d5acfa18169ab34aa8014d706201fa00ea4
This commit is contained in:
Patrick Baumann
2018-05-09 14:34:44 -07:00
committed by android-build-merger

View File

@@ -736,7 +736,13 @@ public final class LoadedApk {
}
if (!libPaths.isEmpty() && SystemProperties.getBoolean(PROPERTY_NAME_APPEND_NATIVE, true)) {
ApplicationLoaders.getDefault().addNative(mClassLoader, libPaths);
// Temporarily disable logging of disk reads on the Looper thread as this is necessary
StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
try {
ApplicationLoaders.getDefault().addNative(mClassLoader, libPaths);
} finally {
StrictMode.setThreadPolicy(oldPolicy);
}
}
if (addedPaths != null && addedPaths.size() > 0) {