Android native file browser returned file path using 'Downloads' smart filter

gui
#1

On most Android devices, loading a file from the native file choose using the ‘Downloads’ smart filter will return a URL (using getURLResult()) that looks something like this:

content://com.android.providers.downloads.documents/document/raw%3A%2Fstorage%2Femulated%2F0%2FDownload%2FJen-mozart-andante.wav

However, on the Pixel 2, loading the same file using the ‘Downloads’ smart filter gives a URL of the form:

content://com.android.providers.downloads.documents/document/681

The former resolves correctly when a call to isLocalFile() or getLocalFile() is made on the URL. The latter does not correctly resolve, and isLocalFile() returns false instead of true as it should. Currently, on the Pixel 2, the user is thus unable to use the ‘Downloads’ smart filter in the file chooser.

0 Likes