Block SAF directory access to /sdcard/Android
This works for target R+ apps, but need to come up with a better story
for target <R. The enforcement in DocumentsUI is target SDK based
and those apps bypass the block_tree flag.
Bug: 157320644
Test: atest DocumentsTest
Change-Id: I93aea7cd5d3b7befea1f78e1cf3f31f8250f1d33
(cherry picked from commit 9d508579ae)
Merged-In: I93aea7cd5d3b7befea1f78e1cf3f31f8250f1d33
This commit is contained in:
@@ -322,6 +322,11 @@ public class ExternalStorageProvider extends FileSystemProvider {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (TextUtils.equals(Environment.DIRECTORY_ANDROID.toLowerCase(),
|
||||
path.toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
} catch (IOException e) {
|
||||
throw new IllegalArgumentException(
|
||||
|
||||
Reference in New Issue
Block a user