use of android.view.textservice.SpellCheckerInfo in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SpellCheckersSettings method onPreferenceChange.
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
final SpellCheckerInfo sci = (SpellCheckerInfo) newValue;
final boolean isSystemApp = (sci.getServiceInfo().applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0;
if (isSystemApp) {
changeCurrentSpellChecker(sci);
return true;
} else {
showSecurityWarnDialog(sci);
return false;
}
}
use of android.view.textservice.SpellCheckerInfo in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SpellCheckerPreferenceControllerTest method updateState_hasSpellerChecker_shouldSetSummaryToAppName.
@Test
public void updateState_hasSpellerChecker_shouldSetSummaryToAppName() {
final String spellCheckerAppLabel = "test";
final SpellCheckerInfo sci = mock(SpellCheckerInfo.class);
when(mTextServicesManager.isSpellCheckerEnabled()).thenReturn(true);
when(mTextServicesManager.getCurrentSpellChecker()).thenReturn(sci);
when(sci.loadLabel(mContext.getPackageManager())).thenReturn(spellCheckerAppLabel);
mController.updateState(mPreference);
assertThat(mPreference.getSummary()).isEqualTo(spellCheckerAppLabel);
}
Aggregations