Bug 1672252 - Ignore case when appending Juno Onboarding privacy link

Due to a difference of lowercase/uppercase letters in the message
shown in Juno Onboarding when displaying the privacy notice link
and having talkback enabled, the app crashed because it could not
find the starting index of the required text. This patch will not
add the link text if the description text does not contain the link
text.

(cherry picked from commit e60f3b88cb8dd554f85cc843b1b70946a6da0c51)
fenix/114.1.0^2
DreVla 1 year ago committed by Mergify
parent fa51e99d75
commit 7d243e43fb

@ -159,7 +159,7 @@ private fun DescriptionText(
description: String,
linkTextState: LinkTextState?,
) {
if (linkTextState != null) {
if (linkTextState != null && description.contains(linkTextState.text, ignoreCase = true)) {
LinkText(
text = description,
linkTextState = linkTextState,
@ -186,7 +186,7 @@ private fun LinkText(
linkTextState: LinkTextState,
) {
val annotatedString = buildAnnotatedString {
val startIndex = text.indexOf(linkTextState.text)
val startIndex = text.indexOf(linkTextState.text, ignoreCase = true)
val endIndex = startIndex + linkTextState.text.length
append(text)
addStyle(

Loading…
Cancel
Save