diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2018-05-09 21:19:53 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-05-09 21:19:53 +0000 |
| commit | 147ef6b1a418c9687af37de48de2e4907430ec9a (patch) | |
| tree | 2f64fa9bbe5eb4c65d37df88dfd52c5f9897d84e /core/java | |
| parent | c8b3e0b6178ef312b86614ebc916bd95636d606e (diff) | |
| parent | 5c5daa4c3f9e0f4b1bb930e27c964c7ae8e059ff (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.java | 8 |
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) { |
