Do not set URL span if span start/end are invalid

The URL span for a wifi dialog's message is set with 0 start/end index
if there is no URL needed. However, this causes an exception if the text
is modified by an accessibility mode (b/169417148). Thus we should avoid
setting the URL span at all if it isn't needed to avoid this bug.

Bug: 232272207
Test: Turn Settings->Accessibility->TalkBack on, launch dialog with
`adb shell cmd wifi launch-dialog-simple -m message` and verify it
doesn't crash.

Change-Id: Ia6cfc94128df3f2a850edea03c2484c9bf179141
1 file changed