correctly integrated PluginManager.java into KP2AKeyboard

This commit is contained in:
Philipp Crocoll 2014-01-25 20:08:09 -08:00
parent 6e0645559d
commit 12dbe597ce

View File

@ -288,6 +288,7 @@ public class KP2AKeyboard extends InputMethodService
}
};
private ClearKeyboardBroadcastReceiver mClearKeyboardReceiver;
private PluginManager mPluginManager;
public class ClearKeyboardBroadcastReceiver extends BroadcastReceiver {
@Override
@ -327,6 +328,17 @@ public class KP2AKeyboard extends InputMethodService
mReCorrectionEnabled = prefs.getBoolean(PREF_RECORRECTION_ENABLED,
getResources().getBoolean(R.bool.default_recorrection_enabled));
Log.d("KP2AK","finding plugin dicts...");
PluginManager.getPluginDictionaries(getApplicationContext());
mPluginManager = new PluginManager(this);
final IntentFilter pFilter = new IntentFilter();
pFilter.addDataScheme("package");
pFilter.addAction("android.intent.action.PACKAGE_ADDED");
pFilter.addAction("android.intent.action.PACKAGE_REPLACED");
pFilter.addAction("android.intent.action.PACKAGE_REMOVED");
registerReceiver(mPluginManager, pFilter);
LatinIMEUtil.GCUtils.getInstance().reset();
boolean tryGC = true;
for (int i = 0; i < LatinIMEUtil.GCUtils.GC_TRY_LOOP_MAX && tryGC; ++i) {
@ -452,7 +464,7 @@ public class KP2AKeyboard extends InputMethodService
mContactsDictionary.close();
}*/
unregisterReceiver(mReceiver);
unregisterReceiver(mPluginManager);
unregisterReceiver(mClearKeyboardReceiver);
LatinImeLogger.commit();