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

* commit 'e5db3871b1269703e5ef360090fb35f50ae57ed4':
  Fix a field value for the suggestion max size Bug: 5574747
main
satok 2011-12-04 23:50:12 -08:00 committed by Android Git Automerger
commit 1da4a94293
1 changed files with 3 additions and 3 deletions

View File

@ -51,7 +51,7 @@ public class SuggestionSpanUtils {
public static final Field FIELD_FLAG_AUTO_CORRECTION public static final Field FIELD_FLAG_AUTO_CORRECTION
= CompatUtils.getField(CLASS_SuggestionSpan, "FLAG_AUTO_CORRECTION"); = CompatUtils.getField(CLASS_SuggestionSpan, "FLAG_AUTO_CORRECTION");
public static final Field FIELD_SUGGESTION_MAX_SIZE 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 public static final Integer OBJ_FLAG_AUTO_CORRECTION = (Integer) CompatUtils
.getFieldValue(null, null, FIELD_FLAG_AUTO_CORRECTION);; .getFieldValue(null, null, FIELD_FLAG_AUTO_CORRECTION);;
public static final Integer OBJ_SUGGESTION_MAX_SIZE = (Integer) CompatUtils public static final Integer OBJ_SUGGESTION_MAX_SIZE = (Integer) CompatUtils
@ -63,7 +63,7 @@ public class SuggestionSpanUtils {
if (LatinImeLogger.sDBG) { if (LatinImeLogger.sDBG) {
if (SUGGESTION_SPAN_IS_SUPPORTED if (SUGGESTION_SPAN_IS_SUPPORTED
&& (OBJ_FLAG_AUTO_CORRECTION == null || OBJ_SUGGESTION_MAX_SIZE == null)) { && (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 class SuggestionSpanUtils {
public static CharSequence getTextWithAutoCorrectionIndicatorUnderline( public static CharSequence getTextWithAutoCorrectionIndicatorUnderline(
Context context, CharSequence text) { Context context, CharSequence text) {
if (TextUtils.isEmpty(text) || CONSTRUCTOR_SuggestionSpan == null if (TextUtils.isEmpty(text) || CONSTRUCTOR_SuggestionSpan == null
|| OBJ_FLAG_AUTO_CORRECTION == null) { || OBJ_FLAG_AUTO_CORRECTION == null || OBJ_SUGGESTION_MAX_SIZE == null) {
return text; return text;
} }
final Spannable spannable = text instanceof Spannable final Spannable spannable = text instanceof Spannable