Loading core/java/android/app/Notification.java +5 −0 Original line number Diff line number Diff line Loading @@ -6469,8 +6469,11 @@ public class Notification implements Parcelable ? super.mBigContentTitle : mConversationTitle; boolean isOneToOne = TextUtils.isEmpty(conversationTitle); CharSequence nameReplacement = null; if (hasOnlyWhiteSpaceSenders()) { isOneToOne = true; nameReplacement = conversationTitle; conversationTitle = null; } RemoteViews contentView = mBuilder.applyStandardTemplateWithActions( mBuilder.getMessagingLayoutResource(), Loading @@ -6489,6 +6492,8 @@ public class Notification implements Parcelable mBuilder.resolveContrastColor()); contentView.setIcon(R.id.status_bar_latest_event_content, "setLargeIcon", mBuilder.mN.mLargeIcon); contentView.setCharSequence(R.id.status_bar_latest_event_content, "setNameReplacement", nameReplacement); contentView.setBoolean(R.id.status_bar_latest_event_content, "setIsOneToOne", isOneToOne); contentView.setBundle(R.id.status_bar_latest_event_content, "setData", Loading core/java/com/android/internal/widget/MessagingGroup.java +5 −2 Original line number Diff line number Diff line Loading @@ -89,9 +89,12 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou mAvatarView = findViewById(R.id.message_icon); } public void setSender(Notification.Person sender) { public void setSender(Notification.Person sender, CharSequence nameOverride) { mSender = sender; mSenderName.setText(sender.getName()); if (nameOverride == null) { nameOverride = sender.getName(); } mSenderName.setText(nameOverride); mNeedsGeneratedAvatar = sender.getIcon() == null; if (!mNeedsGeneratedAvatar) { setAvatar(sender.getIcon()); Loading core/java/com/android/internal/widget/MessagingLayout.java +12 −1 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ public class MessagingLayout extends FrameLayout { private boolean mIsOneToOne; private ArrayList<MessagingGroup> mAddedGroups = new ArrayList<>(); private Notification.Person mUser; private CharSequence mNameReplacement; public MessagingLayout(@NonNull Context context) { super(context); Loading Loading @@ -120,6 +121,11 @@ public class MessagingLayout extends FrameLayout { mLargeIcon = icon; } @RemotableViewMethod public void setNameReplacement(CharSequence nameReplacement) { mNameReplacement = nameReplacement; } @RemotableViewMethod public void setData(Bundle extras) { Parcelable[] messages = extras.getParcelableArray(Notification.EXTRA_MESSAGES); Loading Loading @@ -326,7 +332,12 @@ public class MessagingLayout extends FrameLayout { mAddedGroups.add(newGroup); } newGroup.setLayoutColor(mLayoutColor); newGroup.setSender(senders.get(groupIndex)); Notification.Person sender = senders.get(groupIndex); CharSequence nameOverride = null; if (sender != mUser && mNameReplacement != null) { nameOverride = mNameReplacement; } newGroup.setSender(sender, nameOverride); mGroups.add(newGroup); if (mMessagingLinearLayout.indexOfChild(newGroup) != groupIndex) { Loading Loading
core/java/android/app/Notification.java +5 −0 Original line number Diff line number Diff line Loading @@ -6469,8 +6469,11 @@ public class Notification implements Parcelable ? super.mBigContentTitle : mConversationTitle; boolean isOneToOne = TextUtils.isEmpty(conversationTitle); CharSequence nameReplacement = null; if (hasOnlyWhiteSpaceSenders()) { isOneToOne = true; nameReplacement = conversationTitle; conversationTitle = null; } RemoteViews contentView = mBuilder.applyStandardTemplateWithActions( mBuilder.getMessagingLayoutResource(), Loading @@ -6489,6 +6492,8 @@ public class Notification implements Parcelable mBuilder.resolveContrastColor()); contentView.setIcon(R.id.status_bar_latest_event_content, "setLargeIcon", mBuilder.mN.mLargeIcon); contentView.setCharSequence(R.id.status_bar_latest_event_content, "setNameReplacement", nameReplacement); contentView.setBoolean(R.id.status_bar_latest_event_content, "setIsOneToOne", isOneToOne); contentView.setBundle(R.id.status_bar_latest_event_content, "setData", Loading
core/java/com/android/internal/widget/MessagingGroup.java +5 −2 Original line number Diff line number Diff line Loading @@ -89,9 +89,12 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou mAvatarView = findViewById(R.id.message_icon); } public void setSender(Notification.Person sender) { public void setSender(Notification.Person sender, CharSequence nameOverride) { mSender = sender; mSenderName.setText(sender.getName()); if (nameOverride == null) { nameOverride = sender.getName(); } mSenderName.setText(nameOverride); mNeedsGeneratedAvatar = sender.getIcon() == null; if (!mNeedsGeneratedAvatar) { setAvatar(sender.getIcon()); Loading
core/java/com/android/internal/widget/MessagingLayout.java +12 −1 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ public class MessagingLayout extends FrameLayout { private boolean mIsOneToOne; private ArrayList<MessagingGroup> mAddedGroups = new ArrayList<>(); private Notification.Person mUser; private CharSequence mNameReplacement; public MessagingLayout(@NonNull Context context) { super(context); Loading Loading @@ -120,6 +121,11 @@ public class MessagingLayout extends FrameLayout { mLargeIcon = icon; } @RemotableViewMethod public void setNameReplacement(CharSequence nameReplacement) { mNameReplacement = nameReplacement; } @RemotableViewMethod public void setData(Bundle extras) { Parcelable[] messages = extras.getParcelableArray(Notification.EXTRA_MESSAGES); Loading Loading @@ -326,7 +332,12 @@ public class MessagingLayout extends FrameLayout { mAddedGroups.add(newGroup); } newGroup.setLayoutColor(mLayoutColor); newGroup.setSender(senders.get(groupIndex)); Notification.Person sender = senders.get(groupIndex); CharSequence nameOverride = null; if (sender != mUser && mNameReplacement != null) { nameOverride = mNameReplacement; } newGroup.setSender(sender, nameOverride); mGroups.add(newGroup); if (mMessagingLinearLayout.indexOfChild(newGroup) != groupIndex) { Loading