Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Unified Diff: android/java/src/org/chromium/base/PathUtils.java

Issue 2045223003: Update to Chromium //base at Chromium commit 82baa9afc6620c68cb2168f20bb65e77e3e57f0a. (Closed) Base URL: https://github.com/domokit/base.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « allocator/type_profiler_unittest.cc ('k') | android/scoped_java_ref.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android/java/src/org/chromium/base/PathUtils.java
diff --git a/android/java/src/org/chromium/base/PathUtils.java b/android/java/src/org/chromium/base/PathUtils.java
index 6f29732c786e86b903cc335c9506948e6eeca2ba..c80124fce7df4fc9d41bcb5c0f87fdaf6928ab3c 100644
--- a/android/java/src/org/chromium/base/PathUtils.java
+++ b/android/java/src/org/chromium/base/PathUtils.java
@@ -8,6 +8,7 @@ import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.os.AsyncTask;
import android.os.Environment;
+import android.os.StrictMode;
import org.chromium.base.annotations.CalledByNative;
@@ -115,8 +116,14 @@ public abstract class PathUtils {
@SuppressWarnings("unused")
@CalledByNative
private static String getDownloadsDirectory(Context appContext) {
- return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
- .getPath();
+ // Temporarily allowing disk access while fixing. TODO: http://crbug.com/508615
+ StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
+ try {
+ return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
+ .getPath();
+ } finally {
+ StrictMode.setThreadPolicy(oldPolicy);
+ }
}
/**
« no previous file with comments | « allocator/type_profiler_unittest.cc ('k') | android/scoped_java_ref.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698