From 59f43eab9445a688cfe80a6df575601926601236 Mon Sep 17 00:00:00 2001 From: AdrianDC Date: Tue, 28 Jun 2016 16:20:28 +0200 Subject: [PATCH] SystemUI: Restrict persistent USB drive notifications to USB disks * Without the addition of the isUsb check, a regular FAT32 MicroSD would have a persistent notification that is unwished Change-Id: I396a861702674d0a6a70beb5206fb4c7374ec85d --- .../SystemUI/src/com/android/systemui/usb/StorageNotification.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java index b9c4930a270e..45ff3c24e23f 100644 --- a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java +++ b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java @@ -374,10 +374,13 @@ public class StorageNotification extends SystemUI { mContext.getString(R.string.ext_media_unmount_action), buildUnmountPendingIntent(vol))) .setContentIntent(browseIntent) - .setOngoing(mContext.getResources().getBoolean( - R.bool.config_persistUsbDriveNotification)) .setCategory(Notification.CATEGORY_SYSTEM) .setPriority(Notification.PRIORITY_LOW); + // USB disks notification can be persistent + if (disk.isUsb()) { + builder.setOngoing(mContext.getResources().getBoolean( + R.bool.config_persistUsbDriveNotification)); + } // Non-adoptable disks can't be snoozed. if (disk.isAdoptable()) { builder.setDeleteIntent(buildSnoozeIntent(vol.getFsUuid())); -- 2.11.0