Make the keyboardswitcher and the subtypeswitcher final.

Change-Id: Ifcc79357adcc53f93b190b6e98d5569f42f74655
main
Jean Chalard 2012-03-06 19:06:58 +09:00
parent 3cd1a00eca
commit 89ffb212b4
1 changed files with 8 additions and 5 deletions

View File

@ -193,8 +193,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
private InputMethodManagerCompatWrapper mImm; private InputMethodManagerCompatWrapper mImm;
private Resources mResources; private Resources mResources;
private SharedPreferences mPrefs; private SharedPreferences mPrefs;
private KeyboardSwitcher mKeyboardSwitcher; private final KeyboardSwitcher mKeyboardSwitcher;
private SubtypeSwitcher mSubtypeSwitcher; private final SubtypeSwitcher mSubtypeSwitcher;
private VoiceProxy mVoiceProxy; private VoiceProxy mVoiceProxy;
private UserDictionary mUserDictionary; private UserDictionary mUserDictionary;
@ -486,6 +486,12 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
} }
} }
public LatinIME() {
super();
mSubtypeSwitcher = SubtypeSwitcher.getInstance();
mKeyboardSwitcher = KeyboardSwitcher.getInstance();
}
@Override @Override
public void onCreate() { public void onCreate() {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
@ -500,8 +506,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
super.onCreate(); super.onCreate();
mImm = InputMethodManagerCompatWrapper.getInstance(); mImm = InputMethodManagerCompatWrapper.getInstance();
mSubtypeSwitcher = SubtypeSwitcher.getInstance();
mKeyboardSwitcher = KeyboardSwitcher.getInstance();
mVibrator = VibratorCompatWrapper.getInstance(this); mVibrator = VibratorCompatWrapper.getInstance(this);
mHandler.onCreate(); mHandler.onCreate();
DEBUG = LatinImeLogger.sDBG; DEBUG = LatinImeLogger.sDBG;
@ -549,7 +553,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// Has to be package-visible for unit tests // Has to be package-visible for unit tests
/* package */ void loadSettings() { /* package */ void loadSettings() {
if (null == mPrefs) mPrefs = PreferenceManager.getDefaultSharedPreferences(this); if (null == mPrefs) mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
if (null == mSubtypeSwitcher) mSubtypeSwitcher = SubtypeSwitcher.getInstance();
mSettingsValues = new SettingsValues(mPrefs, this, mSubtypeSwitcher.getInputLocaleStr()); mSettingsValues = new SettingsValues(mPrefs, this, mSubtypeSwitcher.getInputLocaleStr());
resetContactsDictionary(null == mSuggest ? null : mSuggest.getContactsDictionary()); resetContactsDictionary(null == mSuggest ? null : mSuggest.getContactsDictionary());
} }