Remove unneeded Context argument

Change-Id: Ib34931836a617d0dc049fb3c9ae6686374ec8c12
main
Tadashi G. Takaoka 2014-11-21 12:49:04 +09:00
parent 4195567d24
commit 8a711f2a54
5 changed files with 8 additions and 9 deletions

View File

@ -110,7 +110,7 @@ public class RichInputMethodManager {
// Initialize additional subtypes.
SubtypeLocaleUtils.init(context);
final InputMethodSubtype[] additionalSubtypes = getAdditionalSubtypes(context);
final InputMethodSubtype[] additionalSubtypes = getAdditionalSubtypes();
setAdditionalInputMethodSubtypes(additionalSubtypes);
final ConnectivityManager connectivityManager =
@ -119,11 +119,10 @@ public class RichInputMethodManager {
mIsNetworkConnected = (info != null && info.isConnected());
}
public InputMethodSubtype[] getAdditionalSubtypes(final Context context) {
SubtypeLocaleUtils.init(context);
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
public InputMethodSubtype[] getAdditionalSubtypes() {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext);
final String prefAdditionalSubtypes = Settings.readPrefAdditionalSubtypes(
prefs, context.getResources());
prefs, mContext.getResources());
return AdditionalSubtypeUtils.createAdditionalSubtypesArray(prefAdditionalSubtypes);
}

View File

@ -69,7 +69,7 @@ public final class SystemBroadcastReceiver extends BroadcastReceiver {
// subtypes when the package is replaced.
RichInputMethodManager.init(context);
final RichInputMethodManager richImm = RichInputMethodManager.getInstance();
final InputMethodSubtype[] additionalSubtypes = richImm.getAdditionalSubtypes(context);
final InputMethodSubtype[] additionalSubtypes = richImm.getAdditionalSubtypes();
richImm.setAdditionalInputMethodSubtypes(additionalSubtypes);
LauncherIconVisibilityManager.updateSetupWizardIconVisibility(context);
} else if (Intent.ACTION_BOOT_COMPLETED.equals(intentAction)) {

View File

@ -75,7 +75,7 @@ public abstract class KeyboardLayoutSetTestsBase extends AndroidTestCase {
mRichImm = RichInputMethodManager.getInstance();
// Save and reset additional subtypes preference.
mSavedAdditionalSubtypes = mRichImm.getAdditionalSubtypes(context);
mSavedAdditionalSubtypes = mRichImm.getAdditionalSubtypes();
final InputMethodSubtype[] predefinedAdditionalSubtypes =
AdditionalSubtypeUtils.createAdditionalSubtypesArray(
AdditionalSubtypeUtils.createPrefSubtypes(

View File

@ -76,7 +76,7 @@ public class RichInputMethodSubtypeTests extends AndroidTestCase {
mRichImm = RichInputMethodManager.getInstance();
// Save and reset additional subtypes
mSavedAddtionalSubtypes = mRichImm.getAdditionalSubtypes(context);
mSavedAddtionalSubtypes = mRichImm.getAdditionalSubtypes();
final InputMethodSubtype[] predefinedAddtionalSubtypes =
AdditionalSubtypeUtils.createAdditionalSubtypesArray(
AdditionalSubtypeUtils.createPrefSubtypes(

View File

@ -73,7 +73,7 @@ public class SubtypeLocaleUtilsTests extends AndroidTestCase {
mRichImm = RichInputMethodManager.getInstance();
// Save and reset additional subtypes
mSavedAddtionalSubtypes = mRichImm.getAdditionalSubtypes(context);
mSavedAddtionalSubtypes = mRichImm.getAdditionalSubtypes();
final InputMethodSubtype[] predefinedAddtionalSubtypes =
AdditionalSubtypeUtils.createAdditionalSubtypesArray(
AdditionalSubtypeUtils.createPrefSubtypes(