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.
fenix/116.0
DreVla 1 year ago committed by mergify[bot]
parent 9668c3c05e
commit 12d2999d59

@ -171,7 +171,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,
@ -198,7 +198,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