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

Commit 9b3855b7 authored by satok's avatar satok
Browse files

Turn off the spell checker when the spell checker is disabled in the settings

Bug: 5554116
Change-Id: I9816101661e12cafdb9556c7e0bad39833f7dc67
parent 07b4b314
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -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);
        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 */);
                    locale, this,
                    false /* means any available languages from current spell checker */);
        }
        mCurrentLocale = locale;

        // Restore SpellCheckSpans in pool