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

Commit 30c8efa6 authored by Badhri Jagan Sridharan's avatar Badhri Jagan Sridharan
Browse files

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
parent bba60fad
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3183,9 +3183,9 @@
    <!-- See USB_PREFERENCES. This is the message. -->
    <string name="usb_notification_message">Tap for more options.</string>
    <!-- USB_PREFERENCES: Notification for when a type-c USB audio accessory is attached but not supported.  This is the title -->
    <string name="usb_unsupported_audio_accessory_title">Audio accessory not supported</string>
    <string name="usb_unsupported_audio_accessory_title">Analog audio accessory detected</string>
    <!-- Message of notification shown when a type-c USB audio accessory is attached but not supported. -->
    <string name="usb_unsupported_audio_accessory_message">Tap for more info</string>
    <string name="usb_unsupported_audio_accessory_message">The attached device is not compatible with this phone. Tap to learn more.</string>


    <!-- Title of notification shown when ADB is actively connected to the phone. -->
+10 −4
Original line number Diff line number Diff line
@@ -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);