Suppress dictionary pack support when IS_EXPERIMENTAL is true
Change-Id: If8813cb989c1fa8744a3bf36e8514ced3c8f46a3main
parent
c43ff6f66c
commit
710d06cea9
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.android.inputmethod.latin;
|
||||
|
||||
import com.android.inputmethod.latin.define.ProductionFlag;
|
||||
import com.android.inputmethod.latin.makedict.BinaryDictInputOutput;
|
||||
import com.android.inputmethod.latin.makedict.FormatSpec;
|
||||
|
||||
|
@ -422,8 +423,11 @@ final class BinaryDictionaryGetter {
|
|||
// cacheWordListsFromContentProvider returns the list of files it copied to local
|
||||
// storage, but we don't really care about what was copied NOW: what we want is the
|
||||
// list of everything we ever cached, so we ignore the return value.
|
||||
BinaryDictionaryFileDumper.cacheWordListsFromContentProvider(locale, context,
|
||||
hasDefaultWordList);
|
||||
// TODO: The experimental version is not supported by the Dictionary Pack Service yet
|
||||
if (!ProductionFlag.IS_EXPERIMENTAL) {
|
||||
BinaryDictionaryFileDumper.cacheWordListsFromContentProvider(locale, context,
|
||||
hasDefaultWordList);
|
||||
}
|
||||
final File[] cachedWordLists = getCachedWordLists(locale.toString(), context);
|
||||
final String mainDictId = getMainDictId(locale);
|
||||
final DictPackSettings dictPackSettings = new DictPackSettings(context);
|
||||
|
|
|
@ -168,8 +168,10 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
|
|||
private int mDisplayOrientation;
|
||||
|
||||
// Object for reacting to adding/removing a dictionary pack.
|
||||
// TODO: The experimental version is not supported by the Dictionary Pack Service yet.
|
||||
private BroadcastReceiver mDictionaryPackInstallReceiver =
|
||||
new DictionaryPackInstallBroadcastReceiver(this);
|
||||
ProductionFlag.IS_EXPERIMENTAL
|
||||
? null : new DictionaryPackInstallBroadcastReceiver(this);
|
||||
|
||||
// Keeps track of most recently inserted text (multi-character key) for reverting
|
||||
private String mEnteredText;
|
||||
|
@ -410,16 +412,19 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
|
|||
filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);
|
||||
registerReceiver(mReceiver, filter);
|
||||
|
||||
final IntentFilter packageFilter = new IntentFilter();
|
||||
packageFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
|
||||
packageFilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
|
||||
packageFilter.addDataScheme(SCHEME_PACKAGE);
|
||||
registerReceiver(mDictionaryPackInstallReceiver, packageFilter);
|
||||
// TODO: The experimental version is not supported by the Dictionary Pack Service yet.
|
||||
if (!ProductionFlag.IS_EXPERIMENTAL) {
|
||||
final IntentFilter packageFilter = new IntentFilter();
|
||||
packageFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
|
||||
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);
|
||||
final IntentFilter newDictFilter = new IntentFilter();
|
||||
newDictFilter.addAction(
|
||||
DictionaryPackInstallBroadcastReceiver.NEW_DICTIONARY_INTENT_ACTION);
|
||||
registerReceiver(mDictionaryPackInstallReceiver, newDictFilter);
|
||||
}
|
||||
}
|
||||
|
||||
// Has to be package-visible for unit tests
|
||||
|
@ -539,7 +544,10 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
|
|||
mSuggest = null;
|
||||
}
|
||||
unregisterReceiver(mReceiver);
|
||||
unregisterReceiver(mDictionaryPackInstallReceiver);
|
||||
// TODO: The experimental version is not supported by the Dictionary Pack Service yet.
|
||||
if (!ProductionFlag.IS_EXPERIMENTAL) {
|
||||
unregisterReceiver(mDictionaryPackInstallReceiver);
|
||||
}
|
||||
LatinImeLogger.commit();
|
||||
LatinImeLogger.onDestroy();
|
||||
super.onDestroy();
|
||||
|
|
|
@ -203,7 +203,8 @@ public final class Settings extends InputMethodSettingsFragment
|
|||
final Intent intent = dictionaryLink.getIntent();
|
||||
|
||||
final int number = context.getPackageManager().queryIntentActivities(intent, 0).size();
|
||||
if (0 >= number) {
|
||||
// TODO: The experimental version is not supported by the Dictionary Pack Service yet
|
||||
if (ProductionFlag.IS_EXPERIMENTAL || 0 >= number) {
|
||||
textCorrectionGroup.removePreference(dictionaryLink);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue