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

Commit 4da6ec56 authored by jasonwshsu's avatar jasonwshsu
Browse files

Fix: Display full text in "Switch to mic" notification

Root Cause: The default notification style did not have enough space to show full notification text,
so it will get truncated.

Solution: Use BigTextStyle to display more text

Bug: 393968576
Test: manual testing if expand notification will truncate the message
Flag: EXEMPT bugfix
Change-Id: I5dc37627b44ff299b25dba86eccd29e928bc4b78
parent bde7413e
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -221,13 +221,15 @@ public class HearingDevicePhoneCallNotificationController {
        }
        }


        private Notification createSwitchInputNotification(boolean useRemoteMicrophone) {
        private Notification createSwitchInputNotification(boolean useRemoteMicrophone) {
            final CharSequence message = getSwitchInputMessage(useRemoteMicrophone);
            return new Notification.Builder(mContext,
            return new Notification.Builder(mContext,
                    SystemNotificationChannels.ACCESSIBILITY_HEARING_DEVICE)
                    SystemNotificationChannels.ACCESSIBILITY_HEARING_DEVICE)
                    .setContentTitle(getSwitchInputTitle(useRemoteMicrophone))
                    .setContentTitle(getSwitchInputTitle(useRemoteMicrophone))
                    .setContentText(getSwitchInputMessage(useRemoteMicrophone))
                    .setContentText(message)
                    .setSmallIcon(R.drawable.ic_settings_24dp)
                    .setSmallIcon(R.drawable.ic_settings_24dp)
                    .setColor(mContext.getResources().getColor(
                    .setColor(mContext.getResources().getColor(
                            com.android.internal.R.color.system_notification_accent_color))
                            com.android.internal.R.color.system_notification_accent_color))
                    .setStyle(new Notification.BigTextStyle().bigText(message))
                    .setLocalOnly(true)
                    .setLocalOnly(true)
                    .setCategory(Notification.CATEGORY_SYSTEM)
                    .setCategory(Notification.CATEGORY_SYSTEM)
                    .setContentIntent(createPendingIntent(ACTION_BLUETOOTH_DEVICE_DETAILS))
                    .setContentIntent(createPendingIntent(ACTION_BLUETOOTH_DEVICE_DETAILS))