From 30c8efa66ba6b08de951ad672a6004da04059af2 Mon Sep 17 00:00:00 2001 From: Badhri Jagan Sridharan Date: Mon, 31 Jul 2017 12:55:46 -0700 Subject: 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 --- .../usb/java/com/android/server/usb/UsbDeviceManager.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'services/usb/java') 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); -- cgit v1.2.3-59-g8ed1b