Fix ANR when trying to load a message composed of 10,000 random emoji.

This commit is contained in:
Alex Hart
2025-10-09 12:02:16 -03:00
committed by Cody Henthorne
parent f8eaa96412
commit c9a59a7417
3 changed files with 134 additions and 30 deletions

View File

@@ -129,9 +129,10 @@ public class LongMessageFragment extends FullScreenDialogFragment {
CommunicationActions.handlePotentialProxyLinkUrl(requireActivity(), url));
bubble.setVisibility(View.VISIBLE);
text.setText(body);
text.setMovementMethod(LongClickMovementMethod.getInstance(getContext()));
text.setTextSize(TypedValue.COMPLEX_UNIT_SP, SignalStore.settings().getMessageFontSize());
text.setTextAsync(body);
if (!message.get().getMessageRecord().isOutgoing()) {
text.setMentionBackgroundTint(ContextCompat.getColor(requireContext(), ThemeUtil.isDarkTheme(requireActivity()) ? R.color.core_grey_60 : R.color.core_grey_20));
} else {