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

Commit 32db609d authored by Mill Chen's avatar Mill Chen
Browse files

Remove red underline from Device name

- Turn off auto-correction for normal text.

Bug: 79421621
Test: make RunSettingsRoboTest
Change-Id: Ie7c4ebd33073ecaac2048d8630ec7b51e706341c
parent dcfb96ac
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -93,7 +93,8 @@ public class ValidatedEditTextPreference extends CustomEditTextPreferenceCompat
            textView.setInputType(
                    InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
        } else {
            textView.setInputType(InputType.TYPE_CLASS_TEXT);
            textView.setInputType(
                    InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
        }
    }

+12 −0
Original line number Diff line number Diff line
@@ -131,4 +131,16 @@ public class ValidatedEditTextPreferenceTest {
                & (InputType.TYPE_TEXT_VARIATION_PASSWORD | InputType.TYPE_CLASS_TEXT))
                .isNotEqualTo(0);
    }

    @Test
    public void bindViewHolder_isNotPassword_shouldNotAutoCorrectText() {
        final TextView textView = spy(new TextView(RuntimeEnvironment.application));
        when(mViewHolder.findViewById(android.R.id.summary)).thenReturn(textView);

        mPreference.setIsSummaryPassword(false);
        mPreference.onBindViewHolder(mViewHolder);

        assertThat(textView.getInputType()).isEqualTo(
                InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_CLASS_TEXT);
    }
}