Avoid notifying the FUSE daemon for invisible volumes
Invisible volumes/USB OTG volumes are neither exposed to apps nor the MediaStore. Calling into the FUSE daemon for invisible volumes can lead to unexpected exceptions if the MediaProvider tries to get more information about the StorageVolume from the StorageManagerService Test: Manual Bug: 163679723 Change-Id: I9e5e3418c1da15e61942fbedcf440ecca6cdca8c
This commit is contained in:
@@ -338,11 +338,12 @@ public final class StorageSessionController {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@code true} if {@code vol} is an emulated or public volume,
|
||||
* Returns {@code true} if {@code vol} is an emulated or visible public volume,
|
||||
* {@code false} otherwise
|
||||
**/
|
||||
public static boolean isEmulatedOrPublic(VolumeInfo vol) {
|
||||
return vol.type == VolumeInfo.TYPE_EMULATED || vol.type == VolumeInfo.TYPE_PUBLIC;
|
||||
return vol.type == VolumeInfo.TYPE_EMULATED
|
||||
|| (vol.type == VolumeInfo.TYPE_PUBLIC && vol.isVisible());
|
||||
}
|
||||
|
||||
/** Exception thrown when communication with the {@link ExternalStorageService} fails. */
|
||||
|
||||
Reference in New Issue
Block a user