diff options
author | Jeff Sharkey <jsharkey@android.com> | 2015-07-30 18:10:20 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2015-07-30 18:10:39 -0700 |
commit | 865ea7c800883176e5bd9924f27abb3cbacd5178 (patch) | |
tree | 454a08798dc0c5da253f57149e1cdfef5658a2cb /packages | |
parent | eda1cc50cead674287616e6a852f8f281b70b9f5 (diff) | |
download | frameworks_base-865ea7c800883176e5bd9924f27abb3cbacd5178.zip frameworks_base-865ea7c800883176e5bd9924f27abb3cbacd5178.tar.gz frameworks_base-865ea7c800883176e5bd9924f27abb3cbacd5178.tar.bz2 |
Handle volumes without visible paths.
Transient volumes like USB drives are not mounted as visible, so we
shouldn't be kicking off media scanner for them.
Bug: 22545248
Change-Id: Ic8f2d3134f1edb8b2a12e8ff283eceeeb230f48b
Diffstat (limited to 'packages')
-rw-r--r-- | packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java index 4f0c6a41..393771a 100644 --- a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java +++ b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java @@ -162,7 +162,11 @@ public class ExternalStorageProvider extends DocumentsProvider { if (volume.getType() == VolumeInfo.TYPE_PUBLIC) { root.flags |= Root.FLAG_HAS_SETTINGS; } - root.visiblePath = volume.getPathForUser(userId); + if (volume.isVisibleForRead(userId)) { + root.visiblePath = volume.getPathForUser(userId); + } else { + root.visiblePath = null; + } root.path = volume.getInternalPathForUser(userId); root.docId = getDocIdForFile(root.path); |