OSDN Git Service

SystemUI: Add support for persistent usb drive notification.
authorAdnan Begovic <adnan@cyngn.com>
Thu, 2 Jun 2016 22:29:16 +0000 (15:29 -0700)
committerSteve Kondik <steve@cyngn.com>
Tue, 13 Sep 2016 07:12:33 +0000 (00:12 -0700)
  This option can be enabled via config_persistUsbDriveNotification

Change-Id: I331a759aeb914e46e3ef4842896d3465d894707a
TICKET: PAELLA-225

core/res/res/values/cm_symbols.xml
core/res/res/values/config.xml
packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java

index 49e5a9e..231cde4 100644 (file)
@@ -56,4 +56,6 @@
     <java-symbol type="array" name="app_ops_labels" />
     <java-symbol type="string" name="status_bar_su" />
 
+    <!-- Usb drive persistent notification -->
+    <java-symbol type="bool" name="config_persistUsbDriveNotification" />
 </resources>
index 16cf748..e6c4a8a 100755 (executable)
     <string-array name="config_forceEnabledComponents" translatable="false">
     </string-array>
 
+    <!-- Whether to persist the notification for when a usb drive device is plugged in -->
+    <bool name="config_persistUsbDriveNotification">false</bool>
 </resources>
index 97d5e10..b9c4930 100644 (file)
@@ -374,6 +374,8 @@ 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);
             // Non-adoptable disks can't be snoozed.