From 97106ab5af0fdba00d6dbda4767b953e0a5829f4 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Wed, 3 Mar 2010 00:08:31 -0800 Subject: [PATCH] Fix issue #2325621 Runtime restart after launching Android keyboard setting . --- .../com/android/server/InputMethodManagerService.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index a6a3e270efd95..34113cf40e138 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -1475,13 +1475,22 @@ public class InputMethodManagerService extends IInputMethodManager.Stub final List immis = getEnabledInputMethodList(); - int N = (immis == null ? 0 : immis.size()); + if (immis == null) { + return; + } + + int N = immis.size(); mItems = new CharSequence[N]; mIms = new InputMethodInfo[N]; for (int i = 0; i < N; ++i) { InputMethodInfo property = immis.get(i); + if (property == null) { + i--; + N--; + continue; + } mItems[i] = property.loadLabel(pm); mIms[i] = property; }