commit | 79d7528eaf6583926457d9f551f41004ad4fd1a7 | [log] [tgz] |
---|---|---|
author | Zim <zezeozue@google.com> | Fri Dec 04 11:20:02 2020 +0000 |
committer | Anis Assi <anisassi@google.com> | Wed Jun 23 00:15:00 2021 +0000 |
tree | 2fbceead8dd0a2d630780e56bdd06d4c5634ea03 | |
parent | 1d3fa3d9673e339384508f465dddf484b05d4a50 [diff] |
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 9d508579aed406220c11022cfc983da46396bd07) Merged-In: I93aea7cd5d3b7befea1f78e1cf3f31f8250f1d33 (cherry picked from commit 1ea98d44490a2383a604b546a5671a783c1000dd)
diff --git a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java index 11d1b0a..087275e 100644 --- a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java +++ b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java
@@ -322,6 +322,11 @@ return true; } + if (TextUtils.equals(Environment.DIRECTORY_ANDROID.toLowerCase(), + path.toLowerCase())) { + return true; + } + return false; } catch (IOException e) { throw new IllegalArgumentException(