Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2998fc3 authored by pastychang's avatar pastychang Committed by Pasty Chang
Browse files

Remove TtsSpan from Ssid

Telephone type span caused talkback stop to read next texture in Setupwizard wifi page. Remove it and doesn't impact previous issue ag/1468171.
New Google TTS can recognize work and doesn't only spell words.

Test: atest
Bug: b/110104543
Change-Id: I4f37a6280294446e5f33ea3620366803b6d30a4e
parent b03ab2ee
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -756,10 +756,7 @@ public class AccessPoint implements Comparable<AccessPoint> {
    }

    public CharSequence getSsid() {
        final SpannableString str = new SpannableString(ssid);
        str.setSpan(new TtsSpan.TelephoneBuilder(ssid).build(), 0, ssid.length(),
                Spannable.SPAN_INCLUSIVE_INCLUSIVE);
        return str;
        return ssid;
    }

    public String getConfigName() {
+2 −7
Original line number Diff line number Diff line
@@ -104,18 +104,13 @@ public class AccessPointTest {
    }

    @Test
    public void testSsidIsTelephoneSpan() {
    public void testSsidIsSpannableString_returnFalse() {
        final Bundle bundle = new Bundle();
        bundle.putString("key_ssid", TEST_SSID);
        final AccessPoint ap = new AccessPoint(InstrumentationRegistry.getTargetContext(), bundle);
        final CharSequence ssid = ap.getSsid();

        assertThat(ssid instanceof SpannableString).isTrue();

        TtsSpan[] spans = ((SpannableString) ssid).getSpans(0, TEST_SSID.length(), TtsSpan.class);

        assertThat(spans.length).isEqualTo(1);
        assertThat(spans[0].getType()).isEqualTo(TtsSpan.TYPE_TELEPHONE);
        assertThat(ssid instanceof SpannableString).isFalse();
    }

    @Test