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

Commit 28d1b223 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove red underline from Device name"

parents 10995c9b 32db609d
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);
    }
}