diff options
author | 2013-05-15 10:58:55 -0700 | |
---|---|---|
committer | 2013-05-15 10:58:55 -0700 | |
commit | 96d5e291663558b302a2ae2c50afffa5f5caf8d2 (patch) | |
tree | f4b09bcfeebc3ed9916a88e8a6c8f8f200e9a152 /java/src | |
parent | 7710c9d59f00459e52d5ada3db40c4e563e3c1ba (diff) | |
parent | 6448f749154a723b85d4309a37ad8fda2e1434e3 (diff) | |
download | latinime-96d5e291663558b302a2ae2c50afffa5f5caf8d2.tar.gz latinime-96d5e291663558b302a2ae2c50afffa5f5caf8d2.tar.xz latinime-96d5e291663558b302a2ae2c50afffa5f5caf8d2.zip |
am 6448f749: am b35aa487: Merge "Make aggressive threshold really aggressive"
* commit '6448f749154a723b85d4309a37ad8fda2e1434e3':
Make aggressive threshold really aggressive
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/SettingsValues.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/SettingsValues.java b/java/src/com/android/inputmethod/latin/SettingsValues.java index f77a92885..838863c71 100644 --- a/java/src/com/android/inputmethod/latin/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/SettingsValues.java @@ -34,6 +34,9 @@ import java.util.Arrays; */ public final class SettingsValues { private static final String TAG = SettingsValues.class.getSimpleName(); + // "floatNegativeInfinity" is a special marker string for Float.NEGATIVE_INFINITE + // currently used for auto-correction + private static final String FLOAT_NEGATIVE_INFINITY_MARKER_STRING = "floatNegativeInfinity"; // From resources: public final int mDelayUpdateOldSuggestions; @@ -266,8 +269,12 @@ public final class SettingsValues { try { final int arrayIndex = Integer.valueOf(currentAutoCorrectionSetting); if (arrayIndex >= 0 && arrayIndex < autoCorrectionThresholdValues.length) { - autoCorrectionThreshold = Float.parseFloat( - autoCorrectionThresholdValues[arrayIndex]); + final String val = autoCorrectionThresholdValues[arrayIndex]; + if (FLOAT_NEGATIVE_INFINITY_MARKER_STRING.equals(val)) { + autoCorrectionThreshold = Float.NEGATIVE_INFINITY; + } else { + autoCorrectionThreshold = Float.parseFloat(val); + } } } catch (NumberFormatException e) { // Whenever the threshold settings are correct, never come here. @@ -275,7 +282,7 @@ public final class SettingsValues { Log.w(TAG, "Cannot load auto correction threshold setting." + " currentAutoCorrectionSetting: " + currentAutoCorrectionSetting + ", autoCorrectionThresholdValues: " - + Arrays.toString(autoCorrectionThresholdValues)); + + Arrays.toString(autoCorrectionThresholdValues), e); } return autoCorrectionThreshold; } |