Fix NPE that is caused by null EditorInfo
Bug: 3192772 Change-Id: Ia057d29e070ccbb90ee60df1e141de14de95f820main
parent
6a567370ce
commit
d98c20b036
|
@ -513,7 +513,8 @@ public class LatinIME extends InputMethodService
|
||||||
mOrientation = conf.orientation;
|
mOrientation = conf.orientation;
|
||||||
final int mode = mKeyboardSwitcher.getKeyboardMode();
|
final int mode = mKeyboardSwitcher.getKeyboardMode();
|
||||||
final EditorInfo attribute = getCurrentInputEditorInfo();
|
final EditorInfo attribute = getCurrentInputEditorInfo();
|
||||||
mKeyboardSwitcher.loadKeyboard(mode, attribute.imeOptions, mVoiceButtonEnabled,
|
final int imeOptions = (attribute != null) ? attribute.imeOptions : 0;
|
||||||
|
mKeyboardSwitcher.loadKeyboard(mode, imeOptions, mVoiceButtonEnabled,
|
||||||
mVoiceButtonOnPrimary);
|
mVoiceButtonOnPrimary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2273,7 +2274,8 @@ public class LatinIME extends InputMethodService
|
||||||
}
|
}
|
||||||
final int mode = mKeyboardSwitcher.getKeyboardMode();
|
final int mode = mKeyboardSwitcher.getKeyboardMode();
|
||||||
final EditorInfo attribute = getCurrentInputEditorInfo();
|
final EditorInfo attribute = getCurrentInputEditorInfo();
|
||||||
mKeyboardSwitcher.loadKeyboard(mode, attribute.imeOptions, mVoiceButtonEnabled,
|
final int imeOptions = (attribute != null) ? attribute.imeOptions : 0;
|
||||||
|
mKeyboardSwitcher.loadKeyboard(mode, imeOptions, mVoiceButtonEnabled,
|
||||||
mVoiceButtonOnPrimary);
|
mVoiceButtonOnPrimary);
|
||||||
initSuggest(mLanguageSwitcher.getInputLanguage());
|
initSuggest(mLanguageSwitcher.getInputLanguage());
|
||||||
mLanguageSwitcher.persist();
|
mLanguageSwitcher.persist();
|
||||||
|
|
Loading…
Reference in New Issue