diff options
author | 2013-01-06 19:26:16 -0800 | |
---|---|---|
committer | 2013-01-06 19:26:16 -0800 | |
commit | 25d1595ab425835281e68aa0d68e6af11acab478 (patch) | |
tree | 663984ffe04d0a47caa64a84f8f070a8ff1b1059 /java/src/com/android/inputmethod/compat/SuggestionsInfoCompatUtils.java | |
parent | 7e387bc919c443ba90a19b2f0aaccb05a7088468 (diff) | |
parent | b6ca354431367b625daf9fff5fbe4b1f5ef996ab (diff) | |
download | latinime-25d1595ab425835281e68aa0d68e6af11acab478.tar.gz latinime-25d1595ab425835281e68aa0d68e6af11acab478.tar.xz latinime-25d1595ab425835281e68aa0d68e6af11acab478.zip |
am b6ca3544: Small code cleanups
* commit 'b6ca354431367b625daf9fff5fbe4b1f5ef996ab':
Small code cleanups
Diffstat (limited to 'java/src/com/android/inputmethod/compat/SuggestionsInfoCompatUtils.java')
-rw-r--r-- | java/src/com/android/inputmethod/compat/SuggestionsInfoCompatUtils.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/compat/SuggestionsInfoCompatUtils.java b/java/src/com/android/inputmethod/compat/SuggestionsInfoCompatUtils.java index 8314212c9..d8d2be04c 100644 --- a/java/src/com/android/inputmethod/compat/SuggestionsInfoCompatUtils.java +++ b/java/src/com/android/inputmethod/compat/SuggestionsInfoCompatUtils.java @@ -21,10 +21,13 @@ import android.view.textservice.SuggestionsInfo; import java.lang.reflect.Field; public final class SuggestionsInfoCompatUtils { - private static final Field FIELD_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS = CompatUtils.getField( - SuggestionsInfo.class, "RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS"); - private static final Integer OBJ_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS = (Integer) CompatUtils - .getFieldValue(null, null, FIELD_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS); + // Note that SuggestionsInfo.RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS has been introduced + // in API level 15 (Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1). + private static final Field FIELD_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS = + CompatUtils.getField(SuggestionsInfo.class, "RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS"); + private static final Integer OBJ_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS = + (Integer) CompatUtils.getFieldValue(null /* receiver */, null /* defaultValue */, + FIELD_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS); private static final int RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS = OBJ_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS != null ? OBJ_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS : 0; |