summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Abhishek Gadewar <abhishekgadewar@meta.com> 2024-09-27 17:48:31 -0700
committer Cosmin Băieș <cosminbaies@google.com> 2025-02-14 05:17:23 -0800
commit0916f51225dc561def66a2fed4fdbd2e937b17c3 (patch)
treead4b159765568a3c65bad844c007dc2c3df30127
parent8d6fd6ea5beb4c48a796834afbc0e198df2ef4dc (diff)
Fix NPE upon android.intent.action.LOCALE_CHANGED
Summary: Fixing the crash with below log Error: android_crash:java.lang.NullPointerException:com.android.server.inputmethod.InputMethodManagerService.resetDefaultImeLocked Test: No more crash on oculus Change-Id: I734b5d1151b76ed441c2832cf378164ab5925856 Merged-In: I734b5d1151b76ed441c2832cf378164ab5925856 Signed-off-by: Abhishek Gadewar <abhishekgadewar@meta.com>
-rw-r--r--services/core/java/com/android/server/inputmethod/InputMethodManagerService.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index 2bb2b7b21cce..679d341c6f51 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -1294,8 +1294,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
// Do not reset the default (current) IME when it is a 3rd-party IME
String selectedMethodId = bindingController.getSelectedMethodId();
final InputMethodSettings settings = InputMethodSettingsRepository.get(userId);
- if (selectedMethodId != null
- && !settings.getMethodMap().get(selectedMethodId).isSystem()) {
+ final InputMethodInfo selectedImi = settings.getMethodMap().get(selectedMethodId);
+ if (selectedImi != null && !selectedImi.isSystem()) {
return;
}
final List<InputMethodInfo> suitableImes = InputMethodInfoUtils.getDefaultEnabledImes(