Fix not to show a log with empty default ime
It'll make reboot to show a log with empty defualt ime.
Bug: 18165757
Change-Id: I7a0d55bc0da0566a60abb24123c1dbcdd03be9ed
diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java
index 1623eac..edea274 100644
--- a/services/core/java/com/android/server/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/InputMethodManagerService.java
@@ -774,7 +774,11 @@
if (defIm == null && mMethodList.size() > 0) {
defIm = InputMethodUtils.getMostApplicableDefaultIME(
mSettings.getEnabledInputMethodListLocked());
- Slog.i(TAG, "No default found, using " + defIm.getId());
+ if (defIm != null) {
+ Slog.i(TAG, "Default found, using " + defIm.getId());
+ } else {
+ Slog.i(TAG, "No default found");
+ }
}
if (defIm != null) {
setSelectedInputMethodAndSubtypeLocked(defIm, NOT_A_SUBTYPE_ID, false);