diff options
| author | 2017-07-31 12:55:46 -0700 | |
|---|---|---|
| committer | 2017-07-31 17:05:17 -0700 | |
| commit | 30c8efa66ba6b08de951ad672a6004da04059af2 (patch) | |
| tree | fd2f9b023bb4592d80940fcbd80420d01a4676e1 /services/usb/java | |
| parent | bba60fadc7faeefe6afa3fe530e5c7ad36ee4d26 (diff) | |
Reword analog audio not supported notification
New title: Analog audio accessory detected
New message: The attached device is not compatible with this
phone. Tap to learn more.
Also switch to bigTextStyle as the notification message
takes more than one line to display.
Bug: 63962800
Test: Attached analog audio accessory to verify the notification
manually. Also verified that the charging notification remians
untouched.
Change-Id: I5c395bdf3c3dd11f3be8835ec773f087afdc85d9
Diffstat (limited to 'services/usb/java')
| -rw-r--r-- | services/usb/java/com/android/server/usb/UsbDeviceManager.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java index c696b509b4b8..221986395fd3 100644 --- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java +++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java @@ -1161,8 +1161,7 @@ public class UsbDeviceManager { .usb_unsupported_audio_accessory_message); } - Notification notification = - new Notification.Builder(mContext, channel) + Notification.Builder builder = new Notification.Builder(mContext, channel) .setSmallIcon(com.android.internal.R.drawable.stat_sys_adb) .setWhen(0) .setOngoing(true) @@ -1174,8 +1173,15 @@ public class UsbDeviceManager { .setContentTitle(title) .setContentText(message) .setContentIntent(pi) - .setVisibility(Notification.VISIBILITY_PUBLIC) - .build(); + .setVisibility(Notification.VISIBILITY_PUBLIC); + + if (titleRes + == com.android.internal.R.string + .usb_unsupported_audio_accessory_title) { + builder.setStyle(new Notification.BigTextStyle() + .bigText(message)); + } + Notification notification = builder.build(); mNotificationManager.notifyAsUser(null, id, notification, UserHandle.ALL); |