diff --git a/base/android/java/src/org/chromium/base/PathUtils.java b/base/android/java/src/org/chromium/base/PathUtils.java index 05697e2bbceaf..8d676fa850e82 100644 --- a/base/android/java/src/org/chromium/base/PathUtils.java +++ b/base/android/java/src/org/chromium/base/PathUtils.java @@ -23,8 +23,7 @@ public abstract class PathUtils { private static final int DATA_DIRECTORY = 0; private static final int DATABASE_DIRECTORY = 1; private static final int CACHE_DIRECTORY = 2; - private static final int DOWNLOADS_DIRECTORY = 3; - private static final int NUM_DIRECTORIES = 4; + private static final int NUM_DIRECTORIES = 3; private static AsyncTask sDirPathFetchTask; private static File sThumbnailDirectory; @@ -50,10 +49,7 @@ protected String[] doInBackground(String... dataDirectorySuffix) { paths[DATABASE_DIRECTORY] = appContext.getDatabasePath("foo").getParent(); // TODO(wnwen): Find a way to avoid calling this function in renderer process. if (appContext.getCacheDir() != null) { - // These paths are only available in the browser process. paths[CACHE_DIRECTORY] = appContext.getCacheDir().getPath(); - paths[DOWNLOADS_DIRECTORY] = Environment.getExternalStoragePublicDirectory( - Environment.DIRECTORY_DOWNLOADS).getPath(); } return paths; } @@ -119,8 +115,8 @@ public static String getThumbnailCacheDirectoryPath(Context appContext) { @SuppressWarnings("unused") @CalledByNative private static String getDownloadsDirectory(Context appContext) { - assert sDirPathFetchTask != null : "setDataDirectorySuffix must be called first."; - return getDirectoryPath(DOWNLOADS_DIRECTORY); + return Environment.getExternalStoragePublicDirectory( + Environment.DIRECTORY_DOWNLOADS).getPath(); } /**