am a2ce9a49: Fix NPE happening in unit tests.

* commit 'a2ce9a49acbc0842b5a714e8ecbd34be1a786477':
  Fix NPE happening in unit tests.
main
Keisuke Kuroyanagi 2014-05-22 13:07:36 +00:00 committed by Android Git Automerger
commit 9069977fb1
1 changed files with 3 additions and 2 deletions

View File

@ -1747,9 +1747,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
@UsedForTesting
/* package for test */ DistracterFilter createDistracterFilter() {
return new DistracterFilter(this /* Context */,
// Return an empty distracter filter when this method is called before onCreate().
return (mRichImm != null) ? new DistracterFilter(this /* Context */,
mRichImm.getMyEnabledInputMethodSubtypeList(
true /* allowsImplicitlySelectedSubtypes */));
true /* allowsImplicitlySelectedSubtypes */)) : new DistracterFilter();
}
public void dumpDictionaryForDebug(final String dictName) {