Skip to content

Commit 865ea7c

Browse files
committed
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
1 parent eda1cc5 commit 865ea7c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,11 @@ private void updateVolumesLocked() {
162162
if (volume.getType() == VolumeInfo.TYPE_PUBLIC) {
163163
root.flags |= Root.FLAG_HAS_SETTINGS;
164164
}
165-
root.visiblePath = volume.getPathForUser(userId);
165+
if (volume.isVisibleForRead(userId)) {
166+
root.visiblePath = volume.getPathForUser(userId);
167+
} else {
168+
root.visiblePath = null;
169+
}
166170
root.path = volume.getInternalPathForUser(userId);
167171
root.docId = getDocIdForFile(root.path);
168172

0 commit comments

Comments
 (0)