When DownloadTargetDeterminer runs into problem with the download target (e.g. it can't write to the suggested downloads directory, or it can't uniquify the target filename or the filename is too long etc...)
On Android all these errors result in the user being shown the file overwrite infobar. This is due to the logic in ChromeDownloadManagerDelegate introduced in https://codereview.chromium.org/580043002:
void ChromeDownloadManagerDelegate::PromptUserForDownloadPath(
DownloadItem* download,
const base::FilePath& suggested_path,
const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
#if BUILDFLAG(ANDROID_JAVA_UI)
chrome::android::ChromeDownloadManagerOverwriteInfoBarDelegate::Create(
InfoBarService::FromWebContents(download->GetWebContents()),
suggested_path, callback);
#else
DownloadFilePicker::ShowFilePicker(download, suggested_path, callback);
#endif
}
Comment 1 by bugdroid1@chromium.org
, Jul 15 2016