Allow access to all USB directories through SAF.

Test: Manual
Bug: 147755862
Change-Id: I3b9c386a8015a8254ec4ee0b1dc9b18546971891
This commit is contained in:
Stephen Hughes
2020-01-15 13:03:56 -08:00
parent 8d8f3a07f7
commit 4827cdf3de

View File

@@ -319,6 +319,16 @@ public class ExternalStorageProvider extends FileSystemProvider {
return false;
}
// Allow all directories on USB, including the root.
try {
RootInfo rootInfo = getRootFromDocId(docId);
if ((rootInfo.flags & Root.FLAG_REMOVABLE_USB) == Root.FLAG_REMOVABLE_USB) {
return false;
}
} catch (FileNotFoundException e) {
Log.e(TAG, "Failed to determine rootInfo for docId");
}
final String path = getPathFromDocId(docId);
// Block the root of the storage