Commit b1170bcf authored by Xing Liu's avatar Xing Liu Committed by Commit Bot

Android download: Fix missing SD card snackbar on Android Q.

This CL fixed an issue that all downloads on Q with content URI are
recognized as downloads on external SD card.


Bug: 945615
Change-Id: I3ddfb3305359e05e8a38ed17a1d413f8ebb8a529
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1539181Reviewed-by: default avatarMin Qin <qinmin@chromium.org>
Commit-Queue: Xing Liu <xingliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644451}
parent ff1de589
...@@ -1702,7 +1702,7 @@ public class DownloadManagerService ...@@ -1702,7 +1702,7 @@ public class DownloadManagerService
* Returns whether a given file path is in a directory that is no longer available, most likely * Returns whether a given file path is in a directory that is no longer available, most likely
* because it is on an SD card that was removed. * because it is on an SD card that was removed.
* *
* @param filePath The file path to check. * @param filePath The file path to check, can be a content URI.
* @param externalStorageDir The absolute path of external storage directory for primary * @param externalStorageDir The absolute path of external storage directory for primary
* storage. * storage.
* @param directoryOptions All available download directories including primary storage and * @param directoryOptions All available download directories including primary storage and
...@@ -1712,7 +1712,8 @@ public class DownloadManagerService ...@@ -1712,7 +1712,8 @@ public class DownloadManagerService
*/ */
private boolean isFilePathOnMissingExternalDrive(String filePath, String externalStorageDir, private boolean isFilePathOnMissingExternalDrive(String filePath, String externalStorageDir,
ArrayList<DirectoryOption> directoryOptions) { ArrayList<DirectoryOption> directoryOptions) {
if (TextUtils.isEmpty(filePath) || filePath.contains(externalStorageDir)) { if (TextUtils.isEmpty(filePath) || filePath.contains(externalStorageDir)
|| ContentUriUtils.isContentUri(filePath)) {
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment