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

View File

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

View File

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

View File

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

View File

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