InputMethodManagerService: Fix acore crash on boot up

At bootup, while starting the service, if the default Input Method is not set,
it is trying to disable the icon even before the statusbar variable and the input
method icon are initialized. Hence, initializing them before building the input method list.

Change-Id: Ibde2ca3bd379d6620d84b75662ffad1a95a24fc6
This commit is contained in:
Srilakshmi Punuru
2010-08-09 23:48:12 -07:00
committed by Jean-Baptiste Queru
parent 2ffe74ded5
commit efcac2ffba

View File

@@ -469,6 +469,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
screenOnOffFilt.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
mContext.registerReceiver(new ScreenOnOffReceiver(), screenOnOffFilt);
mStatusBar = statusBar;
mInputMethodData = IconData.makeIcon("ime", null, 0, 0, 0);
mInputMethodIcon = statusBar.addIcon(mInputMethodData, null);
statusBar.setIconVisibility(mInputMethodIcon, false);
buildInputMethodListLocked(mMethodList, mMethodMap);
final String enabledStr = Settings.Secure.getString(
@@ -510,11 +515,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
}
}
mStatusBar = statusBar;
mInputMethodData = IconData.makeIcon("ime", null, 0, 0, 0);
mInputMethodIcon = statusBar.addIcon(mInputMethodData, null);
statusBar.setIconVisibility(mInputMethodIcon, false);
mSettingsObserver = new SettingsObserver(mHandler);
updateFromSettingsLocked();
}