Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9960352 authored by Zim's avatar Zim Committed by Zimuzo Ezeozue
Browse files

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
parent 000444ef
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -336,11 +336,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. */