Fix Download file can't be found in setting's recent folder
Symptom:
Download file can't be found in settings recent folder.
Root cause:
When start explore files from Settings, the intent's mType is set to
DocumentsContract.Root.MIME_TYPE_ITEM. While starting DocumentsUI,
State::acceptMimes will be set to "vnd.android.document/root" aka
DocumentsContract.Root.MIME_TYPE_ITEM. When the user tries to open
'Recent', it will finally use RecentsLoader to load all the recent
files. Before actually loading the recent files, it will use
RootsCache::getMatchingRootsBlocking to get all the matching roots.
In RootsCache::getMatchingRoots, it will check whether the target's
mime matches the State::acceptMimes or not. Since State::acceptMimes
is set to DocumentsContract.Root.MIME_TYPE_ITEM, they (video, audio,
image, etc) will fail this match, as a result, there will be no items
found for 'Recent'.
Solution:
If the mime type is "vnd.android.document/root", we will treat it as
'*/*'
Bug: 35415722
Author: JiongXuan Gao <jiongxuan.xa.gao@sonymobile.com>
Change-Id: I816ce0d55b259a7b26ac3c734990a183cd5ab504
1 file changed