aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java28
1 files changed, 6 insertions, 22 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 602de9203..de273b56f 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -221,11 +221,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
private long mLastKeyTime;
private AudioManager mAudioManager;
- private float mFxVolume = -1.0f; // default volume
private boolean mSilentModeOn; // System-wide current configuration
private VibratorCompatWrapper mVibrator;
- private long mKeypressVibrationDuration = -1;
// TODO: Move this flag to VoiceProxy
private boolean mConfigurationChanging;
@@ -550,8 +548,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
if (null == mSubtypeSwitcher) mSubtypeSwitcher = SubtypeSwitcher.getInstance();
mSettingsValues = new SettingsValues(mPrefs, this, mSubtypeSwitcher.getInputLocaleStr());
resetContactsDictionary(null == mSuggest ? null : mSuggest.getContactsDictionary());
- updateSoundEffectVolume();
- updateKeypressVibrationDuration();
}
private void initSuggest() {
@@ -1791,8 +1787,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
prevWord = EditingUtils.getPreviousWord(ic, mSettingsValues.mWordSeparators);
}
// getSuggestedWordBuilder handles gracefully a null value of prevWord
- final SuggestedWords.Builder builder = mSuggest.getSuggestedWordBuilder(
- wordComposer, prevWord, mKeyboardSwitcher.getLatinKeyboard().getProximityInfo());
+ final SuggestedWords.Builder builder = mSuggest.getSuggestedWordBuilder(wordComposer,
+ prevWord, mKeyboardSwitcher.getLatinKeyboard().getProximityInfo(), mCorrectionMode);
boolean autoCorrectionAvailable = !mInputTypeNoAutoCorrect && mSuggest.hasAutoCorrection();
final CharSequence typedWord = wordComposer.getTypedWord();
@@ -2035,7 +2031,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
final CharSequence prevWord = EditingUtils.getThisWord(getCurrentInputConnection(),
mSettingsValues.mWordSeparators);
SuggestedWords.Builder builder = mSuggest.getSuggestedWordBuilder(sEmptyWordComposer,
- prevWord, mKeyboardSwitcher.getLatinKeyboard().getProximityInfo());
+ prevWord, mKeyboardSwitcher.getLatinKeyboard().getProximityInfo(), mCorrectionMode);
if (builder.size() > 0) {
// Explicitly supply an empty typed word (the no-second-arg version of
@@ -2321,11 +2317,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
}
};
- // update keypress sound volume
- private void updateSoundEffectVolume() {
- mFxVolume = Utils.getCurrentKeypressSoundVolume(mPrefs, mResources);
- }
-
// update flags for silent mode
private void updateRingerMode() {
if (mAudioManager == null) {
@@ -2335,10 +2326,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
mSilentModeOn = (mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL);
}
- private void updateKeypressVibrationDuration() {
- mKeypressVibrationDuration = Utils.getCurrentVibrationDuration(mPrefs, mResources);
- }
-
private void playKeyClick(int primaryCode) {
// if mAudioManager is null, we don't have the ringer state yet
// mAudioManager will be set by updateRingerMode
@@ -2363,7 +2350,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
sound = AudioManager.FX_KEYPRESS_STANDARD;
break;
}
- mAudioManager.playSoundEffect(sound, mFxVolume);
+ mAudioManager.playSoundEffect(sound, mSettingsValues.mFxVolume);
}
}
@@ -2371,7 +2358,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
if (!mSettingsValues.mVibrateOn) {
return;
}
- if (mKeypressVibrationDuration < 0) {
+ if (mSettingsValues.mKeypressVibrationDuration < 0) {
// Go ahead with the system default
LatinKeyboardView inputView = mKeyboardSwitcher.getKeyboardView();
if (inputView != null) {
@@ -2380,7 +2367,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
}
} else if (mVibrator != null) {
- mVibrator.vibrate(mKeypressVibrationDuration);
+ mVibrator.vibrate(mSettingsValues.mKeypressVibrationDuration);
}
}
@@ -2399,9 +2386,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
mCorrectionMode = shouldAutoCorrect ? Suggest.CORRECTION_FULL : Suggest.CORRECTION_NONE;
mCorrectionMode = (mSettingsValues.mBigramSuggestionEnabled && shouldAutoCorrect)
? Suggest.CORRECTION_FULL_BIGRAM : mCorrectionMode;
- if (mSuggest != null) {
- mSuggest.setCorrectionMode(mCorrectionMode);
- }
}
private void updateSuggestionVisibility(final SharedPreferences prefs, final Resources res) {