Loading core/java/android/app/Notification.java +2 −1 Original line number Diff line number Diff line Loading @@ -7209,7 +7209,8 @@ public class Notification implements Parcelable * * <p>Starting in {@link Build.VERSION_CODES#R, this conversation title will be ignored if a * valid shortcutId is added via {@link Notification.Builder#setShortcutId(String)}. In this * case, {@link ShortcutInfo#getShortLabel()} will be shown as the conversation title * case, {@link ShortcutInfo#getLongLabel()} (or, if missing, * {@link ShortcutInfo#getShortLabel()}) will be shown as the conversation title * instead. * * <p>This API's behavior was changed in SDK version {@link Build.VERSION_CODES#P}. If your Loading core/java/android/content/pm/ShortcutInfo.java +15 −0 Original line number Diff line number Diff line Loading @@ -1450,6 +1450,21 @@ public final class ShortcutInfo implements Parcelable { return mText; } /** * Returns the {@link #getLongLabel()} if it's populated, and if not, the * {@link #getShortLabel()}. * @hide */ @Nullable public CharSequence getLabel() { CharSequence label = getLongLabel(); if (TextUtils.isEmpty(label)) { label = getShortLabel(); } return label; } /** @hide */ public int getLongLabelResourceId() { return mTextResId; Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/ConversationNotifications.kt +2 −2 Original line number Diff line number Diff line Loading @@ -45,8 +45,8 @@ class ConversationNotificationProcessor @Inject constructor( Notification.MessagingStyle.CONVERSATION_TYPE_NORMAL entry.ranking.shortcutInfo?.let { shortcutInfo -> messagingStyle.shortcutIcon = launcherApps.getShortcutIcon(shortcutInfo) shortcutInfo.shortLabel?.let { shortLabel -> messagingStyle.conversationTitle = shortLabel shortcutInfo.label?.let { label -> messagingStyle.conversationTitle = label } } messagingStyle.unreadMessageCount = Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationChannelHelper.java +5 −5 Original line number Diff line number Diff line Loading @@ -67,14 +67,14 @@ public class NotificationChannelHelper { return channel; } private static String getName(NotificationEntry entry) { if (entry.getRanking().getShortcutInfo().getShortLabel() != null) { return entry.getRanking().getShortcutInfo().getShortLabel().toString(); private static CharSequence getName(NotificationEntry entry) { if (entry.getRanking().getShortcutInfo().getLabel() != null) { return entry.getRanking().getShortcutInfo().getLabel().toString(); } Bundle extras = entry.getSbn().getNotification().extras; String nameString = extras.getString(Notification.EXTRA_CONVERSATION_TITLE); CharSequence nameString = extras.getCharSequence(Notification.EXTRA_CONVERSATION_TITLE); if (TextUtils.isEmpty(nameString)) { nameString = extras.getString(Notification.EXTRA_TITLE); nameString = extras.getCharSequence(Notification.EXTRA_TITLE); } if (TextUtils.isEmpty(nameString)) { nameString = "fallback"; Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/people/PeopleHubNotificationListener.kt +3 −3 Original line number Diff line number Diff line Loading @@ -220,9 +220,9 @@ class PeopleHubDataSourceImpl @Inject constructor( } val clickRunnable = Runnable { notificationListener.unsnoozeNotification(key) } val extras = sbn.notification.extras val name = ranking.shortcutInfo?.shortLabel ?: extras.getString(Notification.EXTRA_CONVERSATION_TITLE) ?: extras.getString(Notification.EXTRA_TITLE) val name = ranking.shortcutInfo?.label ?: extras.getCharSequence(Notification.EXTRA_CONVERSATION_TITLE) ?: extras.getCharSequence(Notification.EXTRA_TITLE) ?: return null val drawable = ranking.getIcon(iconFactory, sbn) ?: iconFactory.getConversationDrawable( Loading Loading
core/java/android/app/Notification.java +2 −1 Original line number Diff line number Diff line Loading @@ -7209,7 +7209,8 @@ public class Notification implements Parcelable * * <p>Starting in {@link Build.VERSION_CODES#R, this conversation title will be ignored if a * valid shortcutId is added via {@link Notification.Builder#setShortcutId(String)}. In this * case, {@link ShortcutInfo#getShortLabel()} will be shown as the conversation title * case, {@link ShortcutInfo#getLongLabel()} (or, if missing, * {@link ShortcutInfo#getShortLabel()}) will be shown as the conversation title * instead. * * <p>This API's behavior was changed in SDK version {@link Build.VERSION_CODES#P}. If your Loading
core/java/android/content/pm/ShortcutInfo.java +15 −0 Original line number Diff line number Diff line Loading @@ -1450,6 +1450,21 @@ public final class ShortcutInfo implements Parcelable { return mText; } /** * Returns the {@link #getLongLabel()} if it's populated, and if not, the * {@link #getShortLabel()}. * @hide */ @Nullable public CharSequence getLabel() { CharSequence label = getLongLabel(); if (TextUtils.isEmpty(label)) { label = getShortLabel(); } return label; } /** @hide */ public int getLongLabelResourceId() { return mTextResId; Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/ConversationNotifications.kt +2 −2 Original line number Diff line number Diff line Loading @@ -45,8 +45,8 @@ class ConversationNotificationProcessor @Inject constructor( Notification.MessagingStyle.CONVERSATION_TYPE_NORMAL entry.ranking.shortcutInfo?.let { shortcutInfo -> messagingStyle.shortcutIcon = launcherApps.getShortcutIcon(shortcutInfo) shortcutInfo.shortLabel?.let { shortLabel -> messagingStyle.conversationTitle = shortLabel shortcutInfo.label?.let { label -> messagingStyle.conversationTitle = label } } messagingStyle.unreadMessageCount = Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationChannelHelper.java +5 −5 Original line number Diff line number Diff line Loading @@ -67,14 +67,14 @@ public class NotificationChannelHelper { return channel; } private static String getName(NotificationEntry entry) { if (entry.getRanking().getShortcutInfo().getShortLabel() != null) { return entry.getRanking().getShortcutInfo().getShortLabel().toString(); private static CharSequence getName(NotificationEntry entry) { if (entry.getRanking().getShortcutInfo().getLabel() != null) { return entry.getRanking().getShortcutInfo().getLabel().toString(); } Bundle extras = entry.getSbn().getNotification().extras; String nameString = extras.getString(Notification.EXTRA_CONVERSATION_TITLE); CharSequence nameString = extras.getCharSequence(Notification.EXTRA_CONVERSATION_TITLE); if (TextUtils.isEmpty(nameString)) { nameString = extras.getString(Notification.EXTRA_TITLE); nameString = extras.getCharSequence(Notification.EXTRA_TITLE); } if (TextUtils.isEmpty(nameString)) { nameString = "fallback"; Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/people/PeopleHubNotificationListener.kt +3 −3 Original line number Diff line number Diff line Loading @@ -220,9 +220,9 @@ class PeopleHubDataSourceImpl @Inject constructor( } val clickRunnable = Runnable { notificationListener.unsnoozeNotification(key) } val extras = sbn.notification.extras val name = ranking.shortcutInfo?.shortLabel ?: extras.getString(Notification.EXTRA_CONVERSATION_TITLE) ?: extras.getString(Notification.EXTRA_TITLE) val name = ranking.shortcutInfo?.label ?: extras.getCharSequence(Notification.EXTRA_CONVERSATION_TITLE) ?: extras.getCharSequence(Notification.EXTRA_TITLE) ?: return null val drawable = ranking.getIcon(iconFactory, sbn) ?: iconFactory.getConversationDrawable( Loading