Android download: Fix storage space UI on Android Q.
On Android Q, Environment.DIRECTORY_DOWNLOADS is an invalid directory, and all disk space queries like getUsableSpace() or getTotalSpace() will return 0, and other related calls may throw exception. This is because we didn't create the directory in external storage. Q basically exposes a bug in our code. This CL adds a utility function to retrieve the directory and tries to create it. Also updates DownloadUtils.isInPrimaryStorageDownloadDirectory to work with content URI file path on Q. Bug: 945028 Change-Id: I22cce2e5ac81bd574eee96719648689c5a8cdbf7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538876Reviewed-by:Min Qin <qinmin@chromium.org> Reviewed-by:
David Trainor <dtrainor@chromium.org> Commit-Queue: Xing Liu <xingliu@chromium.org> Cr-Commit-Position: refs/heads/master@{#644621}
Showing
Please register or sign in to comment