| Index: base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
|
| diff --git a/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java b/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
|
| index d57cd3cb428db58df7a87682b7440e6599cb56f0..24f85d6635fce1bcd806aff172a7d6afb4535de8 100644
|
| --- a/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
|
| +++ b/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
|
| @@ -26,6 +26,7 @@ import android.os.Build;
|
| import android.os.PowerManager;
|
| import android.os.Process;
|
| import android.os.StatFs;
|
| +import android.os.StrictMode;
|
| import android.os.UserManager;
|
| import android.provider.Settings;
|
| import android.text.Html;
|
| @@ -446,10 +447,15 @@ public class ApiCompatibilityUtils {
|
| */
|
| @SuppressWarnings("deprecation")
|
| public static Drawable getDrawable(Resources res, int id) throws NotFoundException {
|
| - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
| - return res.getDrawable(id, null);
|
| - } else {
|
| - return res.getDrawable(id);
|
| + StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
|
| + try {
|
| + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
| + return res.getDrawable(id, null);
|
| + } else {
|
| + return res.getDrawable(id);
|
| + }
|
| + } finally {
|
| + StrictMode.setThreadPolicy(oldPolicy);
|
| }
|
| }
|
|
|
|
|