diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index e934746..72da964 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1444,7 +1444,7 @@
         } else {
             didAutoCorrect = false;
             if (SPACE_STATE_PHANTOM == spaceState) {
-                if (ProductionFlag.IS_INTERNAL) {
+                if (mSettings.isInternal()) {
                     if (mWordComposer.isComposingWord() && mWordComposer.isBatchMode()) {
                         Stats.onAutoCorrection(
                                 "", mWordComposer.getTypedWord(), " ", mWordComposer);
@@ -1499,7 +1499,7 @@
         mHandler.cancelUpdateSuggestionStrip();
         mConnection.beginBatchEdit();
         if (mWordComposer.isComposingWord()) {
-            if (ProductionFlag.IS_INTERNAL) {
+            if (mSettings.isInternal()) {
                 if (mWordComposer.isBatchMode()) {
                     Stats.onAutoCorrection("", mWordComposer.getTypedWord(), " ", mWordComposer);
                 }
@@ -1729,7 +1729,7 @@
             }
         } else {
             if (mLastComposedWord.canRevertCommit()) {
-                if (ProductionFlag.IS_INTERNAL) {
+                if (mSettings.isInternal()) {
                     Stats.onAutoCorrectionCancellation();
                 }
                 revertCommit();
@@ -1888,7 +1888,7 @@
             if (null != mSuggestionStripView) mSuggestionStripView.dismissAddToDictionaryHint();
         }
         mHandler.postUpdateSuggestionStrip();
-        if (ProductionFlag.IS_INTERNAL) {
+        if (mSettings.isInternal()) {
             Utils.Stats.onNonSeparator((char)primaryCode, x, y);
         }
     }
@@ -1955,7 +1955,7 @@
             // already displayed or not, so it's okay.
             setPunctuationSuggestions();
         }
-        if (ProductionFlag.IS_INTERNAL) {
+        if (mSettings.isInternal()) {
             Utils.Stats.onSeparator((char)primaryCode, x, y);
         }
 
@@ -2138,7 +2138,7 @@
                 throw new RuntimeException("We have an auto-correction but the typed word "
                         + "is empty? Impossible! I must commit suicide.");
             }
-            if (ProductionFlag.IS_INTERNAL) {
+            if (mSettings.isInternal()) {
                 Stats.onAutoCorrection(typedWord, autoCorrection, separatorString, mWordComposer);
             }
             if (ProductionFlag.IS_EXPERIMENTAL) {
@@ -2237,7 +2237,7 @@
                 // If the suggestion is not in the dictionary, the hint should be shown.
                 && !AutoCorrection.isValidWord(mSuggest.getUnigramDictionaries(), suggestion, true);
 
-        if (ProductionFlag.IS_INTERNAL) {
+        if (mSettings.isInternal()) {
             Stats.onSeparator((char)Constants.CODE_SPACE,
                     Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE);
         }
@@ -2361,7 +2361,7 @@
             mUserHistoryDictionary.cancelAddingUserHistory(previousWord, committedWord);
         }
         mConnection.commitText(originallyTypedWord + mLastComposedWord.mSeparatorString, 1);
-        if (ProductionFlag.IS_INTERNAL) {
+        if (mSettings.isInternal()) {
             Stats.onSeparator(mLastComposedWord.mSeparatorString,
                     Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE);
         }
@@ -2495,12 +2495,6 @@
         launchSubActivity(SettingsActivity.class);
     }
 
-    // Called from debug code only
-    public void launchDebugSettings() {
-        handleClose();
-        launchSubActivity(DebugSettingsActivity.class);
-    }
-
     public void launchKeyboardedDialogActivity(final Class<? extends Activity> activityClass) {
         // Put the text in the attached EditText into a safe, saved state before switching to a
         // new activity that will also use the soft keyboard.
diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java
index 435074b..4cbfa8e 100644
--- a/java/src/com/android/inputmethod/latin/Settings.java
+++ b/java/src/com/android/inputmethod/latin/Settings.java
@@ -70,6 +70,7 @@
     public static final String PREF_INPUT_LANGUAGE = "input_language";
     public static final String PREF_SELECTED_LANGUAGES = "selected_languages";
     public static final String PREF_DEBUG_SETTINGS = "debug_settings";
+    public static final String PREF_KEY_IS_INTERNAL = "pref_key_is_internal";
 
     // This preference key is deprecated. Use {@link #PREF_SHOW_LANGUAGE_SWITCH_KEY} instead.
     // This is being used only for the backward compatibility.
@@ -127,6 +128,10 @@
         return mSettingsValues;
     }
 
+    public boolean isInternal() {
+        return mSettingsValues.mIsInternal;
+    }
+
     // Accessed from the settings interface, hence public
     public static boolean readKeypressSoundEnabled(final SharedPreferences prefs,
             final Resources res) {
@@ -274,4 +279,8 @@
         }
         return prefs.getBoolean(Settings.PREF_SHOW_SETUP_WIZARD_ICON, false);
     }
+
+    public static boolean isInternal(final SharedPreferences prefs) {
+        return prefs.getBoolean(Settings.PREF_KEY_IS_INTERNAL, false);
+    }
 }
diff --git a/java/src/com/android/inputmethod/latin/SettingsFragment.java b/java/src/com/android/inputmethod/latin/SettingsFragment.java
index 4c90e48..d305285 100644
--- a/java/src/com/android/inputmethod/latin/SettingsFragment.java
+++ b/java/src/com/android/inputmethod/latin/SettingsFragment.java
@@ -92,7 +92,7 @@
 
         final Preference debugSettings = findPreference(Settings.PREF_DEBUG_SETTINGS);
         if (debugSettings != null) {
-            if (ProductionFlag.IS_INTERNAL) {
+            if (Settings.isInternal(prefs)) {
                 final Intent debugSettingsIntent = new Intent(Intent.ACTION_MAIN);
                 debugSettingsIntent.setClassName(
                         context.getPackageName(), DebugSettingsActivity.class.getName());
diff --git a/java/src/com/android/inputmethod/latin/SettingsValues.java b/java/src/com/android/inputmethod/latin/SettingsValues.java
index d058680..f77a928 100644
--- a/java/src/com/android/inputmethod/latin/SettingsValues.java
+++ b/java/src/com/android/inputmethod/latin/SettingsValues.java
@@ -76,6 +76,9 @@
     private final boolean mVoiceKeyEnabled;
     private final boolean mVoiceKeyOnMain;
 
+    // Debug settings
+    public final boolean mIsInternal;
+
     public SettingsValues(final SharedPreferences prefs, final Resources res,
             final InputAttributes inputAttributes) {
         // Get the resources
@@ -141,6 +144,7 @@
                 Settings.PREF_SHOW_SUGGESTIONS_SETTING,
                 res.getString(R.string.prefs_suggestion_visibility_default_value));
         mSuggestionVisibility = createSuggestionVisibility(res, showSuggestionsSetting);
+        mIsInternal = Settings.isInternal(prefs);
     }
 
     public boolean isApplicationSpecifiedCompletionsOn() {
diff --git a/java/src/com/android/inputmethod/latin/define/ProductionFlag.java b/java/src/com/android/inputmethod/latin/define/ProductionFlag.java
index fe9be16..3df0d04 100644
--- a/java/src/com/android/inputmethod/latin/define/ProductionFlag.java
+++ b/java/src/com/android/inputmethod/latin/define/ProductionFlag.java
@@ -22,7 +22,6 @@
     }
 
     public static final boolean IS_EXPERIMENTAL = false;
-    public static final boolean IS_INTERNAL = false;
 
     // When false, IS_EXPERIMENTAL_DEBUG suggests that all guarded class-private DEBUG flags should
     // be false, and any privacy controls should be enforced.  IS_EXPERIMENTAL_DEBUG should be false
