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

Unified Diff: chrome/browser/download/download_path_reservation_tracker.cc

Issue 2117343007: Show download error message if sdcard is not available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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
Index: chrome/browser/download/download_path_reservation_tracker.cc
diff --git a/chrome/browser/download/download_path_reservation_tracker.cc b/chrome/browser/download/download_path_reservation_tracker.cc
index b1d65ea3dabdfb27c18d024ea3f0ce560525e880..34fe46b00fca106bfc938e810ce92498a756b3a8 100644
--- a/chrome/browser/download/download_path_reservation_tracker.cc
+++ b/chrome/browser/download/download_path_reservation_tracker.cc
@@ -21,6 +21,7 @@
#include "base/third_party/icu/icu_utf.h"
#include "build/build_config.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/features.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_item.h"
@@ -202,9 +203,17 @@ bool CreateReservation(
// to the user's "My Documents" directory. We'll prompt them in this case.
if (!base::PathIsWritable(target_dir)) {
DVLOG(1) << "Unable to write to directory \"" << target_dir.value() << "\"";
+#if BUILDFLAG(ANDROID_JAVA_UI)
+ // On Android, DIR_USER_DOCUMENTS is in reality a subdirectory
+ // of DIR_ANDROID_APP_DATA which isn't accessible by other apps.
+ reserved_path->clear();
+ (*g_reservation_map)[key] = *reserved_path;
+ return false;
+#else
is_path_writeable = false;
PathService::Get(chrome::DIR_USER_DOCUMENTS, &target_dir);
target_path = target_dir.Append(filename);
+#endif // BUILDFLAG(ANDROID_JAVA_UI)
}
if (is_path_writeable) {

Powered by Google App Engine
This is Rietveld 408576698