diff --git a/java/src/com/android/inputmethod/latin/SubtypeLocale.java b/java/src/com/android/inputmethod/latin/SubtypeLocale.java
index 7694b56..b7e4884 100644
--- a/java/src/com/android/inputmethod/latin/SubtypeLocale.java
+++ b/java/src/com/android/inputmethod/latin/SubtypeLocale.java
@@ -20,6 +20,7 @@
 
 import android.content.Context;
 import android.content.res.Resources;
+import android.util.Log;
 import android.view.inputmethod.InputMethodSubtype;
 
 import com.android.inputmethod.latin.LocaleUtils.RunInLocale;
@@ -28,7 +29,7 @@
 import java.util.Locale;
 
 public class SubtypeLocale {
-    private static final String TAG = SubtypeLocale.class.getSimpleName();
+    static final String TAG = SubtypeLocale.class.getSimpleName();
     // This class must be located in the same package as LatinIME.java.
     private static final String RESOURCE_PACKAGE_NAME =
             DictionaryFactory.class.getPackage().getName();
@@ -38,7 +39,6 @@
     public static final String QWERTY = "qwerty";
     public static final int UNKNOWN_KEYBOARD_LAYOUT = R.string.subtype_generic;
 
-    private static Context sContext;
     private static String[] sPredefinedKeyboardLayoutSet;
     // Keyboard layout to its display name map.
     private static final HashMap<String, String> sKeyboardKayoutToDisplayNameMap =
@@ -59,7 +59,6 @@
     }
 
     public static void init(Context context) {
-        sContext = context;
         final Resources res = context.getResources();
 
         final String[] predefinedLayoutSet = res.getStringArray(R.array.predefined_layouts);
@@ -129,16 +128,23 @@
     //  en_US azerty T  English (US) (AZERTY)
     //  zz    azerty T  No language (AZERTY)    in system locale
 
-    public static String getSubtypeDisplayName(InputMethodSubtype subtype, Resources res) {
-        // TODO: Remove this check when InputMethodManager.getLastInputMethodSubtype is
-        // fixed.
-        if (!ImfUtils.checkIfSubtypeBelongsToThisIme(sContext, subtype)) return "";
+    public static String getSubtypeDisplayName(final InputMethodSubtype subtype, Resources res) {
         final String language = getSubtypeLocaleDisplayName(subtype.getLocale());
         final int nameResId = subtype.getNameResId();
         final RunInLocale<String> getSubtypeName = new RunInLocale<String>() {
             @Override
             protected String job(Resources res) {
-                return res.getString(nameResId, language);
+                try {
+                    return res.getString(nameResId, language);
+                } catch (Resources.NotFoundException e) {
+                    // TODO: Remove this catch when InputMethodManager.getCurrentInputMethodSubtype
+                    // is fixed.
+                    Log.w(TAG, "Unknown subtype: mode=" + subtype.getMode()
+                            + " locale=" + subtype.getLocale()
+                            + " extra=" + subtype.getExtraValue()
+                            + "\n" + Utils.getStackTrace());
+                    return "";
+                }
             }
         };
         final Locale locale = isNoLanguage(subtype)
diff --git a/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java b/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java
index 8863bcf..c70c2fd 100644
--- a/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java
+++ b/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java
@@ -30,14 +30,12 @@
     // Locale to subtypes list.
     private final ArrayList<InputMethodSubtype> mSubtypesList = new ArrayList<InputMethodSubtype>();
 
-    private Context mContext;
     private Resources mRes;
 
     @Override
     protected void setUp() throws Exception {
         super.setUp();
         final Context context = getContext();
-        mContext = context;
         mRes = context.getResources();
         SubtypeLocale.init(context);
     }
@@ -124,10 +122,6 @@
         final InputMethodSubtype ZZ_AZERTY = AdditionalSubtype.createAdditionalSubtype(
                 SubtypeLocale.NO_LANGUAGE, "azerty", null);
 
-        ImfUtils.setAdditionalInputMethodSubtypes(mContext, new InputMethodSubtype[] {
-                DE_QWERTY, FR_QWERTZ, US_AZERTY, ZZ_AZERTY
-        });
-
         final RunInLocale<Void> tests = new RunInLocale<Void>() {
             @Override
             protected Void job(Resources res) {
@@ -191,10 +185,6 @@
         final InputMethodSubtype ZZ_AZERTY = AdditionalSubtype.createAdditionalSubtype(
                 SubtypeLocale.NO_LANGUAGE, "azerty", null);
 
-        ImfUtils.setAdditionalInputMethodSubtypes(mContext, new InputMethodSubtype[] {
-                DE_QWERTY, FR_QWERTZ, US_AZERTY, ZZ_AZERTY
-        });
-
         final RunInLocale<Void> tests = new RunInLocale<Void>() {
             @Override
             protected Void job(Resources res) {
