diff options
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/dictionarypack/WordListPreference.java | 11 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/SettingsValues.java | 13 |
2 files changed, 12 insertions, 12 deletions
diff --git a/java/src/com/android/inputmethod/dictionarypack/WordListPreference.java b/java/src/com/android/inputmethod/dictionarypack/WordListPreference.java index 93f12d53e..f042795dd 100644 --- a/java/src/com/android/inputmethod/dictionarypack/WordListPreference.java +++ b/java/src/com/android/inputmethod/dictionarypack/WordListPreference.java @@ -16,10 +16,9 @@ package com.android.inputmethod.dictionarypack; -import android.app.Dialog; import android.content.Context; import android.content.SharedPreferences; -import android.preference.DialogPreference; +import android.preference.Preference; import android.util.Log; import android.view.View; import android.view.ViewGroup; @@ -38,7 +37,7 @@ import java.util.Locale; * pack. Upon being pressed, it displays a menu to allow the user to install, disable, * enable or delete it as appropriate for the current state of the word list. */ -public final class WordListPreference extends DialogPreference { +public final class WordListPreference extends Preference { static final private String TAG = WordListPreference.class.getSimpleName(); // What to display in the "status" field when we receive unknown data as a status from @@ -93,12 +92,6 @@ public final class WordListPreference extends DialogPreference { if (status == mStatus) return; mStatus = status; setSummary(getSummary(status)); - // If we are currently displaying the dialog, we should update it, or at least - // dismiss it. - final Dialog dialog = getDialog(); - if (null != dialog) { - dialog.dismiss(); - } } private String getSummary(final int status) { 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; } |