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

Commit b53d6172 authored by Jean Chalard's avatar Jean Chalard Committed by Android (Google) Code Review
Browse files

Merge "Receive a broadcast that the dictionary has been updated."

parents 3047baa4 646d950e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -30,6 +30,11 @@ import android.net.Uri;
public class DictionaryPackInstallBroadcastReceiver extends BroadcastReceiver {

    final LatinIME mService;
    /**
     * The action of the intent for publishing that new dictionary data is available.
     */
    /* package */ static final String NEW_DICTIONARY_INTENT_ACTION =
            "com.android.inputmethod.latin.dictionarypack.newdict";

    public DictionaryPackInstallBroadcastReceiver(final LatinIME service) {
        mService = service;
@@ -77,6 +82,8 @@ public class DictionaryPackInstallBroadcastReceiver extends BroadcastReceiver {
            // TODO: Only reload dictionary on REMOVED when the removed package is the one we
            // read dictionary from?
            mService.resetSuggestMainDict();
        } else if (action.equals(NEW_DICTIONARY_INTENT_ACTION)) {
            mService.resetSuggestMainDict();
        }
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -440,6 +440,11 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
        packageFilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
        packageFilter.addDataScheme(SCHEME_PACKAGE);
        registerReceiver(mDictionaryPackInstallReceiver, packageFilter);

        final IntentFilter newDictFilter = new IntentFilter();
        newDictFilter.addAction(
                DictionaryPackInstallBroadcastReceiver.NEW_DICTIONARY_INTENT_ACTION);
        registerReceiver(mDictionaryPackInstallReceiver, newDictFilter);
    }

    private void initSuggest() {