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

Commit a3508c68 authored by Tom Marshall's avatar Tom Marshall Committed by Gerrit Code Review
Browse files

storage: Do not notify for volumes on non-removable disks

Change-Id: Ia353ab43fbeba42d7d9c21d926f638f550a3dbbe
parent 69e16db8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -47,6 +47,8 @@ public class DiskInfo implements Parcelable {
    public static final int FLAG_DEFAULT_PRIMARY = 1 << 1;
    public static final int FLAG_SD = 1 << 2;
    public static final int FLAG_USB = 1 << 3;
    public static final int FLAG_EMMC = 1 << 4;
    public static final int FLAG_NON_REMOVABLE = 1 << 5;

    public final String id;
    public final int flags;
@@ -128,6 +130,10 @@ public class DiskInfo implements Parcelable {
        return (flags & FLAG_USB) != 0;
    }

    public boolean isNonRemovable() {
        return (flags & FLAG_NON_REMOVABLE) != 0;
    }

    @Override
    public String toString() {
        final CharArrayWriter writer = new CharArrayWriter();
+5 −0
Original line number Diff line number Diff line
@@ -273,6 +273,11 @@ public class StorageNotification extends SystemUI {
    }

    private void onPublicVolumeStateChangedInternal(VolumeInfo vol) {
        // Do not notify for volumes on non-removable disks
        if (vol.disk.isNonRemovable()) {
            return;
        }

        Log.d(TAG, "Notifying about public volume: " + vol.toString());

        final Notification notif;