Fix a field value for the suggestion max size
Bug: 5574747

This bug was introduced by I5e40edf6f790c078c4a05d

Change-Id: I5b0f51e1f5e8a12d786657167082bc604089505e
diff --git a/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java b/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
index 164d2b7..161ef09 100644
--- a/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
+++ b/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
@@ -51,7 +51,7 @@
     public static final Field FIELD_FLAG_AUTO_CORRECTION
             = CompatUtils.getField(CLASS_SuggestionSpan, "FLAG_AUTO_CORRECTION");
     public static final Field FIELD_SUGGESTION_MAX_SIZE
-            = CompatUtils.getField(CLASS_SuggestionSpan, "SUGGESTION_MAX_SIZE");
+            = CompatUtils.getField(CLASS_SuggestionSpan, "SUGGESTIONS_MAX_SIZE");
     public static final Integer OBJ_FLAG_AUTO_CORRECTION = (Integer) CompatUtils
             .getFieldValue(null, null, FIELD_FLAG_AUTO_CORRECTION);;
     public static final Integer OBJ_SUGGESTION_MAX_SIZE = (Integer) CompatUtils
@@ -63,7 +63,7 @@
         if (LatinImeLogger.sDBG) {
             if (SUGGESTION_SPAN_IS_SUPPORTED
                     && (OBJ_FLAG_AUTO_CORRECTION == null || OBJ_SUGGESTION_MAX_SIZE == null)) {
-                Log.e(TAG, "Field is accidentially null.");
+                throw new RuntimeException("Field is accidentially null.");
             }
         }
     }
@@ -71,7 +71,7 @@
     public static CharSequence getTextWithAutoCorrectionIndicatorUnderline(
             Context context, CharSequence text) {
         if (TextUtils.isEmpty(text) || CONSTRUCTOR_SuggestionSpan == null
-                || OBJ_FLAG_AUTO_CORRECTION == null) {
+                || OBJ_FLAG_AUTO_CORRECTION == null || OBJ_SUGGESTION_MAX_SIZE == null) {
             return text;
         }
         final Spannable spannable = text instanceof Spannable