From 242057d6f941a40162f6ae5c43e0384879a58cee Mon Sep 17 00:00:00 2001 From: Steve Elliott Date: Wed, 10 Jun 2020 15:15:19 -0400 Subject: [PATCH] Strip formatting from convo senders and title Fixes: 155919582 Test: manual Change-Id: I942050db02b4a559fb9ffcc6c9929e49f2f7232f --- .../com/android/internal/widget/ConversationLayout.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/java/com/android/internal/widget/ConversationLayout.java b/core/java/com/android/internal/widget/ConversationLayout.java index 075159671b17e..851aa10df459e 100644 --- a/core/java/com/android/internal/widget/ConversationLayout.java +++ b/core/java/com/android/internal/widget/ConversationLayout.java @@ -72,6 +72,7 @@ import com.android.internal.util.ContrastColorUtil; import java.util.ArrayList; import java.util.List; import java.util.Locale; +import java.util.Objects; import java.util.function.Consumer; import java.util.regex.Pattern; @@ -795,7 +796,8 @@ public class ConversationLayout extends FrameLayout */ @RemotableViewMethod public void setConversationTitle(CharSequence conversationTitle) { - mConversationTitle = conversationTitle; + // Remove formatting from the title. + mConversationTitle = conversationTitle != null ? conversationTitle.toString() : null; } public CharSequence getConversationTitle() { @@ -1052,6 +1054,9 @@ public class ConversationLayout extends FrameLayout groups.add(currentGroup); if (sender == null) { sender = mUser; + } else { + // Remove all formatting from the sender name + sender = sender.toBuilder().setName(Objects.toString(sender.getName())).build(); } senders.add(sender); currentSenderKey = key;