From b86ca76cea9aedf47a81f9272fb59897de3bbbe7 Mon Sep 17 00:00:00 2001 From: Dan Zivkovic Date: Fri, 6 Mar 2015 14:34:57 -0800 Subject: Handle null InputMethodSubtype. Bug 19627494. Change-Id: I50dc77c59ced0f2e7c07a49ae0cb040197c2ab35 --- java/src/com/android/inputmethod/latin/RichInputMethodManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/RichInputMethodManager.java') diff --git a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java index c8e0b93bf..602205b59 100644 --- a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java +++ b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java @@ -46,6 +46,7 @@ import java.util.Map; import java.util.Set; import javax.annotation.Nonnull; +import javax.annotation.Nullable; /** * Enrichment class for InputMethodManager to simplify interaction and add functionality. @@ -329,7 +330,7 @@ public class RichInputMethodManager { @UsedForTesting static void forceSubtype(@Nonnull final InputMethodSubtype subtype) { - sForcedSubtypeForTesting = new RichInputMethodSubtype(subtype); + sForcedSubtypeForTesting = RichInputMethodSubtype.getRichInputMethodSubtype(subtype); } @Nonnull @@ -488,8 +489,8 @@ public class RichInputMethodManager { return true; } - private void updateCurrentSubtype(@Nonnull final InputMethodSubtype subtype) { - mCurrentRichInputMethodSubtype = new RichInputMethodSubtype(subtype); + private void updateCurrentSubtype(@Nullable final InputMethodSubtype subtype) { + mCurrentRichInputMethodSubtype = RichInputMethodSubtype.getRichInputMethodSubtype(subtype); } private void updateShortcutIme() { -- cgit v1.2.3-83-g751a