Fix issue where "learn more" link on 5G NR settings doesn't work.
Issue is due to the fact the footer text is a spannable string which
although different from the original text loaded when the preference
was constructed, is the same in terms of object equality.
Clearing the preference title before assigning the footer text fixes this.
Fixes: 162011372
Test: Manual test; open settings and verify link is clickable now.
Merged-In: I5d22c665b0d6fb842bc54dc55a2eb3045e0092a2
Change-Id: I5d22c665b0d6fb842bc54dc55a2eb3045e0092a2
(cherry picked from commit 97d8711d84
)
Exempt-From-Owner-Approval: Straight cherry-pick.
This commit is contained in:
@@ -55,6 +55,13 @@ public class NrDisabledInDsdsFooterPreferenceController extends BasePreferenceCo
|
||||
super.updateState(preference);
|
||||
|
||||
if (preference != null) {
|
||||
// This is necessary to ensure that setting the title to the spannable string returned
|
||||
// by getFooterText will be accepted. Internally, setTitle does an equality check on
|
||||
// the spannable string being set to the text already set on the preference. That
|
||||
// equality check apparently only takes into account the raw text and not and spannables
|
||||
// that are part of the text. So we clear the title before applying the spannable
|
||||
// footer to ensure it is accepted.
|
||||
preference.setTitle("");
|
||||
preference.setTitle(getFooterText());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user