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

Commit 1b981a3a authored by Martijn Coenen's avatar Martijn Coenen
Browse files

Don't update quota for non-emulated volumes.

Since they don't support quota. Also, don't throw an exception if we
can't find a volume for the passed-in path, but warn instead: the volume
may be unstable and have disappeared by the time we do this.

Bug: 152618535
Test: boot emulated image; verify no crashes when inserting media on
      public storage
Change-Id: I0e6b8f5c9f9f35b80b7bd5f6255a70e210a30474
parent ddb33e9d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2447,7 +2447,12 @@ public class StorageManager {
        final String filePath = path.getCanonicalPath();
        final StorageVolume volume = getStorageVolume(path);
        if (volume == null) {
            throw new IllegalStateException("Failed to update quota type for " + filePath);
            Log.w(TAG, "Failed to update quota type for " + filePath);
            return;
        }
        if (!volume.isEmulated()) {
            // We only support quota tracking on emulated filesystems
            return;
        }

        final int userId = volume.getOwner().getIdentifier();