| 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 6f5603e3cd5531094121b5ebd8efb2d92bec6fe0..28cc9cf2e556fa3c51011c301016dbfff58d13ca 100644
|
| --- a/chrome/browser/download/download_path_reservation_tracker.cc
|
| +++ b/chrome/browser/download/download_path_reservation_tracker.cc
|
| @@ -20,6 +20,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"
|
|
|
| @@ -164,7 +165,6 @@ bool CreateReservation(
|
| base::FilePath* reserved_path) {
|
| DCHECK_CURRENTLY_ON(BrowserThread::FILE);
|
| DCHECK(suggested_path.IsAbsolute());
|
| -
|
| // Create a reservation map if one doesn't exist. It will be automatically
|
| // deleted when all the reservations are revoked.
|
| if (g_reservation_map == NULL)
|
| @@ -202,9 +202,16 @@ 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();
|
| + 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) {
|
|
|