From 60acfdf4a85fa96a72488d3cef24eccb02393ab9 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Fri, 4 Nov 2011 12:36:38 +0900 Subject: [PATCH] Skip loading keyboard when SoftInputWindow hasn't shown yet. (DO NOT MERGE) This is cherry-pick of I003101b2 from Master for Bug: 5541192 Bug: 5636367 Change-Id: I560126d17be6a770b19c1f1347332ebdfde5d671 --- java/src/com/android/inputmethod/latin/LatinIME.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index d57154ad5..40d1bd560 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -2100,8 +2100,12 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // so that we need to re-create the keyboard input view here. setInputView(mKeyboardSwitcher.onCreateInputView()); } - // Reload keyboard because the current language has been changed. - mKeyboardSwitcher.loadKeyboard(getCurrentInputEditorInfo(), mSettingsValues); + // When the device locale is changed in SetupWizard etc., this method may get called via + // onConfigurationChanged before SoftInputWindow is shown. + if (mKeyboardSwitcher.getKeyboardView() != null) { + // Reload keyboard because the current language has been changed. + mKeyboardSwitcher.loadKeyboard(getCurrentInputEditorInfo(), mSettingsValues); + } initSuggest(); loadSettings(); }