diff --git a/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java b/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
index 2766cc3..164d2b7 100644
--- a/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
+++ b/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
@@ -16,6 +16,7 @@
 
 package com.android.inputmethod.compat;
 
+import com.android.inputmethod.latin.LatinImeLogger;
 import com.android.inputmethod.latin.SuggestedWords;
 import com.android.inputmethod.latin.SuggestionSpanPickedNotificationReceiver;
 
@@ -27,6 +28,7 @@
 import android.util.Log;
 
 import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.Locale;
 
@@ -38,9 +40,6 @@
     public static final String SUGGESTION_SPAN_PICKED_AFTER = "after";
     public static final String SUGGESTION_SPAN_PICKED_BEFORE = "before";
     public static final String SUGGESTION_SPAN_PICKED_HASHCODE = "hashcode";
-    // TODO: Use the API constant after it gets public.
-    public static final int FLAG_AUTO_CORRECTION = 0x0004;
-    public static final int SUGGESTION_MAX_SIZE = 5;
     public static final boolean SUGGESTION_SPAN_IS_SUPPORTED;
 
     private static final Class<?> CLASS_SuggestionSpan = CompatUtils
@@ -49,20 +48,36 @@
             Context.class, Locale.class, String[].class, int.class, Class.class };
     private static final Constructor<?> CONSTRUCTOR_SuggestionSpan = CompatUtils
             .getConstructor(CLASS_SuggestionSpan, INPUT_TYPE_SuggestionSpan);
+    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");
+    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
+            .getFieldValue(null, null, FIELD_SUGGESTION_MAX_SIZE);;
+
     static {
         SUGGESTION_SPAN_IS_SUPPORTED =
                 CLASS_SuggestionSpan != null && CONSTRUCTOR_SuggestionSpan != null;
+        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.");
+            }
+        }
     }
 
     public static CharSequence getTextWithAutoCorrectionIndicatorUnderline(
             Context context, CharSequence text) {
-        if (TextUtils.isEmpty(text) || CONSTRUCTOR_SuggestionSpan == null) {
+        if (TextUtils.isEmpty(text) || CONSTRUCTOR_SuggestionSpan == null
+                || OBJ_FLAG_AUTO_CORRECTION == null) {
             return text;
         }
         final Spannable spannable = text instanceof Spannable
                 ? (Spannable) text : new SpannableString(text);
         final Object[] args =
-                { context, null, new String[] {}, FLAG_AUTO_CORRECTION,
+                { context, null, new String[] {}, (int)OBJ_FLAG_AUTO_CORRECTION,
                         (Class<?>) SuggestionSpanPickedNotificationReceiver.class };
         final Object ss = CompatUtils.newInstance(CONSTRUCTOR_SuggestionSpan, args);
         if (ss == null) {
@@ -78,7 +93,8 @@
             CharSequence pickedWord, SuggestedWords suggestedWords) {
         if (TextUtils.isEmpty(pickedWord) || CONSTRUCTOR_SuggestionSpan == null
                 || suggestedWords == null || suggestedWords.size() == 0
-                || suggestedWords.getInfo(0).isObsoleteSuggestedWord()) {
+                || suggestedWords.getInfo(0).isObsoleteSuggestedWord()
+                || OBJ_SUGGESTION_MAX_SIZE == null) {
             return pickedWord;
         }
 
@@ -90,7 +106,7 @@
         }
         final ArrayList<String> suggestionsList = new ArrayList<String>();
         for (int i = 0; i < suggestedWords.size(); ++i) {
-            if (suggestionsList.size() >= SUGGESTION_MAX_SIZE) {
+            if (suggestionsList.size() >= OBJ_SUGGESTION_MAX_SIZE) {
                 break;
             }
             final CharSequence word = suggestedWords.getWord(i);
