diff options
author | 2013-01-06 11:10:27 +0900 | |
---|---|---|
committer | 2013-01-07 12:13:42 +0900 | |
commit | b6ca354431367b625daf9fff5fbe4b1f5ef996ab (patch) | |
tree | 1358c683e123161cc04bc6ad83eb75c763ec53b3 /java/src/com/android/inputmethod/compat/SuggestionsInfoCompatUtils.java | |
parent | f677681330143e3e50871222d33ade594e6348ce (diff) | |
download | latinime-b6ca354431367b625daf9fff5fbe4b1f5ef996ab.tar.gz latinime-b6ca354431367b625daf9fff5fbe4b1f5ef996ab.tar.xz latinime-b6ca354431367b625daf9fff5fbe4b1f5ef996ab.zip |
Small code cleanups
Multi-project commit with I249d5fbe
Change-Id: Ia28c4e970992aa1299a30e604eaa5d096655c3a5
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; |