summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2018-05-09 21:19:53 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-05-09 21:19:53 +0000
commit147ef6b1a418c9687af37de48de2e4907430ec9a (patch)
tree2f64fa9bbe5eb4c65d37df88dfd52c5f9897d84e /core/java
parentc8b3e0b6178ef312b86614ebc916bd95636d606e (diff)
parent5c5daa4c3f9e0f4b1bb930e27c964c7ae8e059ff (diff)
Merge "Allows disk reads when adding native paths to classloader" into pi-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/LoadedApk.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/java/android/app/LoadedApk.java b/core/java/android/app/LoadedApk.java
index 4b84ed4adc30..ca3257f24207 100644
--- a/core/java/android/app/LoadedApk.java
+++ b/core/java/android/app/LoadedApk.java
@@ -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) {