Merge "Turn off the spell checker when the spell checker is disabled in the settings" into ics-mr1

This commit is contained in:
Ken Wakasa
2011-11-04 01:02:12 -07:00
committed by Android (Google) Code Review

View File

@@ -84,9 +84,14 @@ public class SpellChecker implements SpellCheckerSessionListener {
private void setLocale(Locale locale) {
final TextServicesManager textServicesManager = (TextServicesManager)
mTextView.getContext().getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE);
mSpellCheckerSession = textServicesManager.newSpellCheckerSession(
null /* Bundle not currently used by the textServicesManager */,
locale, this, false /* means any available languages from current spell checker */);
if (!textServicesManager.isSpellCheckerEnabled()) {
mSpellCheckerSession = null;
} else {
mSpellCheckerSession = textServicesManager.newSpellCheckerSession(
null /* Bundle not currently used by the textServicesManager */,
locale, this,
false /* means any available languages from current spell checker */);
}
mCurrentLocale = locale;
// Restore SpellCheckSpans in pool