Skip to content

Commit efcac2f

Browse files
Srilakshmi PunuruJean-Baptiste Queru
authored andcommitted
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
1 parent 2ffe74d commit efcac2f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

services/java/com/android/server/InputMethodManagerService.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,11 @@ public void executeMessage(Message msg) {
469469
screenOnOffFilt.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
470470
mContext.registerReceiver(new ScreenOnOffReceiver(), screenOnOffFilt);
471471

472+
mStatusBar = statusBar;
473+
mInputMethodData = IconData.makeIcon("ime", null, 0, 0, 0);
474+
mInputMethodIcon = statusBar.addIcon(mInputMethodData, null);
475+
statusBar.setIconVisibility(mInputMethodIcon, false);
476+
472477
buildInputMethodListLocked(mMethodList, mMethodMap);
473478

474479
final String enabledStr = Settings.Secure.getString(
@@ -510,11 +515,6 @@ public void executeMessage(Message msg) {
510515
}
511516
}
512517

513-
mStatusBar = statusBar;
514-
mInputMethodData = IconData.makeIcon("ime", null, 0, 0, 0);
515-
mInputMethodIcon = statusBar.addIcon(mInputMethodData, null);
516-
statusBar.setIconVisibility(mInputMethodIcon, false);
517-
518518
mSettingsObserver = new SettingsObserver(mHandler);
519519
updateFromSettingsLocked();
520520
}

0 commit comments

Comments
 (0)