Remove red underline from Device name
- Turn off auto-correction for normal text. Bug: 79421621 Test: make RunSettingsRoboTest Change-Id: Ie7c4ebd33073ecaac2048d8630ec7b51e706341c
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user