Merge "Receive a broadcast that the dictionary has been updated."
commit
b53d6172ef
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue