diff --git a/src/com/android/settings/DeviceAdminSettings.java b/src/com/android/settings/DeviceAdminSettings.java
index 350d731..9391439 100644
--- a/src/com/android/settings/DeviceAdminSettings.java
+++ b/src/com/android/settings/DeviceAdminSettings.java
@@ -49,7 +49,6 @@
 import android.widget.TextView;
 
 import com.android.internal.logging.nano.MetricsProto;
-import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.core.instrumentation.Instrumentable;
 import com.android.settings.core.instrumentation.VisibilityLoggerMixin;
 
@@ -137,9 +136,7 @@
         super.onActivityCreated(savedInstanceState);
         setHasOptionsMenu(true);
         Utils.forceCustomPadding(getListView(), true /* additive padding */);
-        if (InstrumentedPreferenceFragment.usePreferenceScreenTitle()) {
-            getActivity().setTitle(R.string.manage_device_admin);
-        }
+        getActivity().setTitle(R.string.manage_device_admin);
     }
 
     @Override
diff --git a/src/com/android/settings/MasterClear.java b/src/com/android/settings/MasterClear.java
index 96cc390..7a6f966 100644
--- a/src/com/android/settings/MasterClear.java
+++ b/src/com/android/settings/MasterClear.java
@@ -95,9 +95,7 @@
     @Override
     public void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        if (usePreferenceScreenTitle()) {
-            getActivity().setTitle(R.string.master_clear_title);
-        }
+        getActivity().setTitle(R.string.master_clear_title);
     }
 
     /**
diff --git a/src/com/android/settings/ResetNetwork.java b/src/com/android/settings/ResetNetwork.java
index dc89d05..0f08c26 100644
--- a/src/com/android/settings/ResetNetwork.java
+++ b/src/com/android/settings/ResetNetwork.java
@@ -68,9 +68,7 @@
     @Override
     public void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        if (usePreferenceScreenTitle()) {
-            getActivity().setTitle(R.string.reset_network_title);
-        }
+        getActivity().setTitle(R.string.reset_network_title);
     }
 
     /**
diff --git a/src/com/android/settings/ScreenPinningSettings.java b/src/com/android/settings/ScreenPinningSettings.java
index 68050b1..b3b6868 100644
--- a/src/com/android/settings/ScreenPinningSettings.java
+++ b/src/com/android/settings/ScreenPinningSettings.java
@@ -65,9 +65,7 @@
         super.onActivityCreated(savedInstanceState);
 
         final SettingsActivity activity = (SettingsActivity) getActivity();
-        if (usePreferenceScreenTitle()) {
-            activity.setTitle(R.string.screen_pinning_title);
-        }
+        activity.setTitle(R.string.screen_pinning_title);
         mLockPatternUtils = new LockPatternUtils(activity);
 
 
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 1a013cc..f1c2a0a 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -209,12 +209,7 @@
 
     @Override
     public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
-        if (InstrumentedPreferenceFragment.usePreferenceScreenTitle()) {
-            startPreferencePanel(caller, pref.getFragment(), pref.getExtras(), -1, null, null, 0);
-        } else {
-            startPreferencePanel(caller, pref.getFragment(), pref.getExtras(), -1, pref.getTitle(),
-                    null, 0);
-        }
+        startPreferencePanel(caller, pref.getFragment(), pref.getExtras(), -1, null, null, 0);
         return true;
     }
 
@@ -631,13 +626,8 @@
     public void startPreferencePanel(Fragment caller, String fragmentClass, Bundle args,
             int titleRes, CharSequence titleText, Fragment resultTo, int resultRequestCode) {
         String title = null;
-        if (titleRes < 0) {
-            if (titleText != null) {
-                title = titleText.toString();
-            } else if (!InstrumentedPreferenceFragment.usePreferenceScreenTitle()) {
-                // There not much we can do in that case
-                title = "";
-            }
+        if (titleRes < 0 && titleText != null) {
+            title = titleText.toString();
         }
         Utils.startWithFragment(this, fragmentClass, args, resultTo, resultRequestCode,
                 titleRes, title, mIsShortcut, mMetricsFeatureProvider.getMetricsCategory(caller));
diff --git a/src/com/android/settings/TrustedCredentialsSettings.java b/src/com/android/settings/TrustedCredentialsSettings.java
index 479a914..491419a 100644
--- a/src/com/android/settings/TrustedCredentialsSettings.java
+++ b/src/com/android/settings/TrustedCredentialsSettings.java
@@ -203,9 +203,7 @@
         filter.addAction(Intent.ACTION_MANAGED_PROFILE_UNLOCKED);
         activity.registerReceiver(mWorkProfileChangedReceiver, filter);
 
-        if (usePreferenceScreenTitle()) {
-            activity.setTitle(R.string.trusted_credentials);
-        }
+        activity.setTitle(R.string.trusted_credentials);
     }
 
     @Override
diff --git a/src/com/android/settings/UserCredentialsSettings.java b/src/com/android/settings/UserCredentialsSettings.java
index f8966a5..54e12a8 100644
--- a/src/com/android/settings/UserCredentialsSettings.java
+++ b/src/com/android/settings/UserCredentialsSettings.java
@@ -87,9 +87,7 @@
     @Override
     public void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        if (usePreferenceScreenTitle()) {
-            getActivity().setTitle(R.string.user_credentials);
-        }
+        getActivity().setTitle(R.string.user_credentials);
     }
 
     protected void announceRemoval(String alias) {
diff --git a/src/com/android/settings/accessibility/AccessibilitySettings.java b/src/com/android/settings/accessibility/AccessibilitySettings.java
index 15e0095..877894b 100644
--- a/src/com/android/settings/accessibility/AccessibilitySettings.java
+++ b/src/com/android/settings/accessibility/AccessibilitySettings.java
@@ -521,9 +521,7 @@
             extras.putString(EXTRA_PREFERENCE_KEY, preference.getKey());
             extras.putBoolean(EXTRA_CHECKED, serviceEnabled);
             extras.putString(EXTRA_TITLE, title);
-            if (usePreferenceScreenTitle()) {
-                extras.putParcelable(EXTRA_RESOLVE_INFO, resolveInfo);
-            }
+            extras.putParcelable(EXTRA_RESOLVE_INFO, resolveInfo);
 
             String description = info.loadDescription(getPackageManager());
             if (TextUtils.isEmpty(description)) {
diff --git a/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragment.java b/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragment.java
index 0f6bdd7..c437a16 100644
--- a/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragment.java
@@ -59,9 +59,6 @@
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
-        if (!usePreferenceScreenTitle()) {
-            addPreferencesFromResource(R.xml.accessibility_shortcut_settings);
-        }
         mServicePreference = findPreference(SHORTCUT_SERVICE_KEY);
         mOnLockScreenSwitchPreference = (SwitchPreference) findPreference(ON_LOCK_SCREEN_KEY);
         mOnLockScreenSwitchPreference.setOnPreferenceChangeListener((Preference p, Object o) -> {
diff --git a/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java b/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
index 7ad4d41..d0197cf 100644
--- a/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
@@ -141,10 +141,8 @@
                 Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED);
         extras.putString(AccessibilitySettings.EXTRA_TITLE, getString(
                 R.string.accessibility_screen_magnification_navbar_title));
-        if (usePreferenceScreenTitle()) {
-            extras.putInt(AccessibilitySettings.EXTRA_TITLE_RES,
-                    R.string.accessibility_screen_magnification_navbar_title);
-        }
+        extras.putInt(AccessibilitySettings.EXTRA_TITLE_RES,
+                R.string.accessibility_screen_magnification_navbar_title);
         extras.putCharSequence(AccessibilitySettings.EXTRA_SUMMARY,
                 getActivity().getResources().getText(
                         R.string.accessibility_screen_magnification_navbar_summary));
@@ -194,10 +192,8 @@
                 Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED);
         extras.putString(AccessibilitySettings.EXTRA_TITLE, context.getString(
                 R.string.accessibility_screen_magnification_gestures_title));
-        if (usePreferenceScreenTitle()) {
-            extras.putInt(AccessibilitySettings.EXTRA_TITLE_RES,
-                    R.string.accessibility_screen_magnification_gestures_title);
-        }
+        extras.putInt(AccessibilitySettings.EXTRA_TITLE_RES,
+                R.string.accessibility_screen_magnification_gestures_title);
         extras.putCharSequence(AccessibilitySettings.EXTRA_SUMMARY, context.getResources().getText(
                 R.string.accessibility_screen_magnification_summary));
         extras.putBoolean(AccessibilitySettings.EXTRA_CHECKED,
diff --git a/src/com/android/settings/accessibility/ToggleAutoclickPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleAutoclickPreferenceFragment.java
index 5fa38e1..a94b72c 100644
--- a/src/com/android/settings/accessibility/ToggleAutoclickPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleAutoclickPreferenceFragment.java
@@ -20,7 +20,6 @@
 import android.os.Bundle;
 import android.provider.Settings;
 import android.support.v7.preference.Preference;
-import android.view.View;
 import android.view.accessibility.AccessibilityManager;
 import android.widget.Switch;
 
@@ -29,7 +28,6 @@
 import com.android.settings.widget.SeekBarPreference;
 import com.android.settings.widget.SwitchBar;
 
-
 /**
  * Fragment for preference screen for settings related to Automatically click after mouse stops
  * feature.
@@ -118,10 +116,6 @@
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
-        if (!usePreferenceScreenTitle()) {
-            addPreferencesFromResource(R.xml.accessibility_autoclick_settings);
-        }
-
         int delay = Settings.Secure.getInt(
                 getContentResolver(), Settings.Secure.ACCESSIBILITY_AUTOCLICK_DELAY,
                 AccessibilityManager.AUTOCLICK_DELAY_DEFAULT);
@@ -157,15 +151,6 @@
     }
 
     @Override
-    public void onViewCreated(View view, Bundle savedInstanceState) {
-        super.onViewCreated(view, savedInstanceState);
-
-        if (!usePreferenceScreenTitle()) {
-            setTitle(getString(R.string.accessibility_autoclick_preference_title));
-        }
-    }
-
-    @Override
     public boolean onPreferenceChange(Preference preference, Object newValue) {
         if (preference == mDelay && newValue instanceof Integer) {
             Settings.Secure.putInt(getContentResolver(),
diff --git a/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
index 6ee7217..8e76e48 100644
--- a/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
@@ -20,7 +20,6 @@
 import android.provider.Settings;
 import android.support.v7.preference.ListPreference;
 import android.support.v7.preference.Preference;
-import android.view.View;
 import android.view.accessibility.AccessibilityManager;
 import android.widget.Switch;
 
@@ -50,10 +49,6 @@
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
-        if (!usePreferenceScreenTitle()) {
-            addPreferencesFromResource(R.xml.accessibility_daltonizer_settings);
-        }
-
         mType = (ListPreference) findPreference("type");
 
         if (!AccessibilitySettings.isColorTransformAccelerated(getActivity())) {
@@ -84,15 +79,6 @@
     }
 
     @Override
-    public void onViewCreated(View view, Bundle savedInstanceState) {
-        super.onViewCreated(view, savedInstanceState);
-
-        if (!usePreferenceScreenTitle()) {
-            setTitle(getString(R.string.accessibility_display_daltonizer_preference_title));
-        }
-    }
-
-    @Override
     protected void onInstallSwitchBarToggleSwitch() {
         super.onInstallSwitchBarToggleSwitch();
 
diff --git a/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
index e647954..85d3a2f 100644
--- a/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
@@ -42,7 +42,7 @@
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         final int resId = getPreferenceScreenResId();
-        if (!usePreferenceScreenTitle() || resId <= 0) {
+        if (resId <= 0) {
             PreferenceScreen preferenceScreen = getPreferenceManager().createPreferenceScreen(
                     getActivity());
             setPreferenceScreen(preferenceScreen);
@@ -119,8 +119,7 @@
         }
 
         // Title.
-        if (usePreferenceScreenTitle()
-                && arguments.containsKey(AccessibilitySettings.EXTRA_RESOLVE_INFO)) {
+        if (arguments.containsKey(AccessibilitySettings.EXTRA_RESOLVE_INFO)) {
             ResolveInfo info = arguments.getParcelable(AccessibilitySettings.EXTRA_RESOLVE_INFO);
             getActivity().setTitle(info.loadLabel(getPackageManager()).toString());
         } else if (arguments.containsKey(AccessibilitySettings.EXTRA_TITLE)) {
diff --git a/src/com/android/settings/accessibility/ToggleFontSizePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleFontSizePreferenceFragment.java
index 3e1e732..8c15e5b 100644
--- a/src/com/android/settings/accessibility/ToggleFontSizePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleFontSizePreferenceFragment.java
@@ -52,9 +52,7 @@
         for (int i = 0; i < strEntryValues.length; ++i) {
             mValues[i] = Float.parseFloat(strEntryValues[i]);
         }
-        if (usePreferenceScreenTitle()) {
-            getActivity().setTitle(R.string.title_font_size);
-        }
+        getActivity().setTitle(R.string.title_font_size);
     }
 
     @Override
diff --git a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
index 35f7375..ecb4b9f 100644
--- a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
@@ -216,8 +216,7 @@
             mInitialSetting = arguments.getBoolean(AccessibilitySettings.EXTRA_CHECKED);
         }
 
-        if (usePreferenceScreenTitle()
-                && arguments.containsKey(AccessibilitySettings.EXTRA_TITLE_RES)) {
+        if (arguments.containsKey(AccessibilitySettings.EXTRA_TITLE_RES)) {
             final int titleRes = arguments.getInt(AccessibilitySettings.EXTRA_TITLE_RES);
             if (titleRes > 0) {
                 getActivity().setTitle(titleRes);
diff --git a/src/com/android/settings/applications/ConvertToFbe.java b/src/com/android/settings/applications/ConvertToFbe.java
index 192cd14..5f5ebd9 100644
--- a/src/com/android/settings/applications/ConvertToFbe.java
+++ b/src/com/android/settings/applications/ConvertToFbe.java
@@ -29,7 +29,6 @@
 import com.android.settings.R;
 import com.android.settings.SettingsActivity;
 import com.android.settings.core.InstrumentedFragment;
-import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.password.ChooseLockSettingsHelper;
 
 /* Class to prompt for conversion of userdata to file based encryption
@@ -49,9 +48,7 @@
     @Override
     public void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        if (InstrumentedPreferenceFragment.usePreferenceScreenTitle()) {
-            getActivity().setTitle(R.string.convert_to_file_encryption);
-        }
+        getActivity().setTitle(R.string.convert_to_file_encryption);
     }
 
     @Override
diff --git a/src/com/android/settings/applications/ManageDomainUrls.java b/src/com/android/settings/applications/ManageDomainUrls.java
index 93416ad..adf406a 100644
--- a/src/com/android/settings/applications/ManageDomainUrls.java
+++ b/src/com/android/settings/applications/ManageDomainUrls.java
@@ -65,9 +65,6 @@
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         setAnimationAllowed(true);
-        if (!usePreferenceScreenTitle()) {
-            setPreferenceScreen(getPreferenceManager().createPreferenceScreen(getContext()));
-        }
         mApplicationsState = ApplicationsState.getInstance(
                 (Application) getContext().getApplicationContext());
         mSession = mApplicationsState.newSession(this, getLifecycle());
diff --git a/src/com/android/settings/applications/PictureInPictureSettings.java b/src/com/android/settings/applications/PictureInPictureSettings.java
index 3dc8ab3..01d14f4 100644
--- a/src/com/android/settings/applications/PictureInPictureSettings.java
+++ b/src/com/android/settings/applications/PictureInPictureSettings.java
@@ -148,9 +148,6 @@
         mPackageManager = new PackageManagerWrapper(mContext.getPackageManager());
         mUserManager = new UserManagerWrapper(mContext.getSystemService(UserManager.class));
         mIconDrawableFactory = IconDrawableFactory.newInstance(mContext);
-        if (!usePreferenceScreenTitle()) {
-            setPreferenceScreen(getPreferenceManager().createPreferenceScreen(mContext));
-        }
     }
 
     @Override
diff --git a/src/com/android/settings/applications/PremiumSmsAccess.java b/src/com/android/settings/applications/PremiumSmsAccess.java
index b6613f2..ab6ea24 100644
--- a/src/com/android/settings/applications/PremiumSmsAccess.java
+++ b/src/com/android/settings/applications/PremiumSmsAccess.java
@@ -124,14 +124,8 @@
         if (apps == null) return;
         setEmptyText(R.string.premium_sms_none);
         setLoading(false, true);
-        final PreferenceScreen screen;
-        if (usePreferenceScreenTitle()) {
-            screen = getPreferenceScreen();
-            screen.removeAll();
-        } else {
-            screen = getPreferenceManager().createPreferenceScreen(getPrefContext());
-        }
-
+        final PreferenceScreen screen = getPreferenceScreen();
+        screen.removeAll();
         screen.setOrderingAsAdded(true);
 
         for (int i = 0; i < apps.size(); i++) {
@@ -145,10 +139,6 @@
             footer.setTitle(R.string.premium_sms_warning);
             screen.addPreference(footer);
         }
-
-        if (!usePreferenceScreenTitle()) {
-            setPreferenceScreen(screen);
-        }
     }
 
     private void update() {
diff --git a/src/com/android/settings/applications/RunningServices.java b/src/com/android/settings/applications/RunningServices.java
index dd8f278..4e3d629 100644
--- a/src/com/android/settings/applications/RunningServices.java
+++ b/src/com/android/settings/applications/RunningServices.java
@@ -44,9 +44,7 @@
 
         setHasOptionsMenu(true);
 
-        if (usePreferenceScreenTitle()) {
-            getActivity().setTitle(R.string.runningservices_settings_title);
-        }
+        getActivity().setTitle(R.string.runningservices_settings_title);
     }
 
     @Override
diff --git a/src/com/android/settings/applications/appops/BackgroundCheckSummary.java b/src/com/android/settings/applications/appops/BackgroundCheckSummary.java
index f46e6a4..d9db9aa 100644
--- a/src/com/android/settings/applications/appops/BackgroundCheckSummary.java
+++ b/src/com/android/settings/applications/appops/BackgroundCheckSummary.java
@@ -40,9 +40,7 @@
     @Override
     public void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        if (usePreferenceScreenTitle()) {
-            getActivity().setTitle(R.string.background_check_pref);
-        }
+        getActivity().setTitle(R.string.background_check_pref);
     }
 
     @Override
diff --git a/src/com/android/settings/applications/manageapplications/ManageApplications.java b/src/com/android/settings/applications/manageapplications/ManageApplications.java
index 7dc8951..d55c996 100644
--- a/src/com/android/settings/applications/manageapplications/ManageApplications.java
+++ b/src/com/android/settings/applications/manageapplications/ManageApplications.java
@@ -293,7 +293,7 @@
 
         mResetAppsHelper = new ResetAppsHelper(activity);
 
-        if (usePreferenceScreenTitle() && screenTitle > 0) {
+        if (screenTitle > 0) {
             activity.setTitle(screenTitle);
         }
     }
diff --git a/src/com/android/settings/core/FeatureFlags.java b/src/com/android/settings/core/FeatureFlags.java
index f3bf3e7..91699d4 100644
--- a/src/com/android/settings/core/FeatureFlags.java
+++ b/src/com/android/settings/core/FeatureFlags.java
@@ -24,5 +24,4 @@
     public static final String DEV_OPTION_V1 = "dev_option_v1";
     public static final String SEARCH_V2 = "settings_search_v2";
     public static final String SUGGESTIONS_V2 = "new_settings_suggestion";
-    public static final String USE_PREFERENCE_SCREEN_TITLE = "settings_use_preference_screen_title";
 }
diff --git a/src/com/android/settings/core/InstrumentedPreferenceFragment.java b/src/com/android/settings/core/InstrumentedPreferenceFragment.java
index 31a0c27..ea82f13 100644
--- a/src/com/android/settings/core/InstrumentedPreferenceFragment.java
+++ b/src/com/android/settings/core/InstrumentedPreferenceFragment.java
@@ -68,11 +68,9 @@
 
     @Override
     public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
-        if (usePreferenceScreenTitle()) {
-            final int resId = getPreferenceScreenResId();
-            if (resId > 0) {
-                addPreferencesFromResource(resId);
-            }
+        final int resId = getPreferenceScreenResId();
+        if (resId > 0) {
+            addPreferencesFromResource(resId);
         }
     }
 
@@ -82,10 +80,6 @@
         updateActivityTitleWithScreenTitle(getPreferenceScreen());
     }
 
-    public static boolean usePreferenceScreenTitle() {
-        return FeatureFlagUtils.isEnabled(FeatureFlags.USE_PREFERENCE_SCREEN_TITLE) || true;
-    }
-
     protected final Context getPrefContext() {
         return getPreferenceManager().getContext();
     }
@@ -102,7 +96,7 @@
     }
 
     private void updateActivityTitleWithScreenTitle(PreferenceScreen screen) {
-        if (usePreferenceScreenTitle() && screen != null) {
+        if (screen != null) {
             final CharSequence title = screen.getTitle();
             if (!TextUtils.isEmpty(title)) {
                 getActivity().setTitle(title);
diff --git a/src/com/android/settings/datausage/DataUsagePreference.java b/src/com/android/settings/datausage/DataUsagePreference.java
index 35cfbbc..32c7011 100644
--- a/src/com/android/settings/datausage/DataUsagePreference.java
+++ b/src/com/android/settings/datausage/DataUsagePreference.java
@@ -37,15 +37,13 @@
 
     public DataUsagePreference(Context context, AttributeSet attrs) {
         super(context, attrs);
-        if (InstrumentedPreferenceFragment.usePreferenceScreenTitle()) {
-            final TypedArray a = context.obtainStyledAttributes(
-                    attrs, new int[] { com.android.internal.R.attr.title },
-                    TypedArrayUtils.getAttr(
-                            context, android.support.v7.preference.R.attr.preferenceStyle,
-                            android.R.attr.preferenceStyle), 0);
-            mTitleRes = a.getResourceId(0, 0);
-            a.recycle();
-        }
+        final TypedArray a = context.obtainStyledAttributes(
+                attrs, new int[] { com.android.internal.R.attr.title },
+                TypedArrayUtils.getAttr(
+                        context, android.support.v7.preference.R.attr.preferenceStyle,
+                        android.R.attr.preferenceStyle), 0);
+        mTitleRes = a.getResourceId(0, 0);
+        a.recycle();
     }
 
     @Override
diff --git a/src/com/android/settings/datausage/UnrestrictedDataAccess.java b/src/com/android/settings/datausage/UnrestrictedDataAccess.java
index 2bf2e01..be289b2 100644
--- a/src/com/android/settings/datausage/UnrestrictedDataAccess.java
+++ b/src/com/android/settings/datausage/UnrestrictedDataAccess.java
@@ -59,9 +59,6 @@
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         setAnimationAllowed(true);
-        if (!usePreferenceScreenTitle()) {
-            addPreferencesFromResource(R.xml.unrestricted_data_access_settings);
-        }
         mApplicationsState = ApplicationsState.getInstance(
                 (Application) getContext().getApplicationContext());
         mDataSaverBackend = new DataSaverBackend(getContext());
diff --git a/src/com/android/settings/datetime/ZonePicker.java b/src/com/android/settings/datetime/ZonePicker.java
index 57f9b7d..57c340c 100644
--- a/src/com/android/settings/datetime/ZonePicker.java
+++ b/src/com/android/settings/datetime/ZonePicker.java
@@ -35,7 +35,6 @@
 
 import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
-import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.core.instrumentation.Instrumentable;
 import com.android.settings.core.instrumentation.VisibilityLoggerMixin;
 import com.android.settingslib.datetime.ZoneGetter;
@@ -167,9 +166,7 @@
         // Sets the adapter
         setSorting(true);
         setHasOptionsMenu(true);
-        if (InstrumentedPreferenceFragment.usePreferenceScreenTitle()) {
-            activity.setTitle(R.string.date_time_set_timezone);
-        }
+        activity.setTitle(R.string.date_time_set_timezone);
     }
 
     @Override
diff --git a/src/com/android/settings/display/ScreenZoomSettings.java b/src/com/android/settings/display/ScreenZoomSettings.java
index f9a23c7..a77782f 100644
--- a/src/com/android/settings/display/ScreenZoomSettings.java
+++ b/src/com/android/settings/display/ScreenZoomSettings.java
@@ -71,9 +71,7 @@
             mDefaultDensity = density.getDefaultDensity();
         }
 
-        if (usePreferenceScreenTitle()) {
-            getActivity().setTitle(R.string.screen_zoom_title);
-        }
+        getActivity().setTitle(R.string.screen_zoom_title);
     }
 
     @Override
diff --git a/src/com/android/settings/language/PhoneLanguagePreferenceController.java b/src/com/android/settings/language/PhoneLanguagePreferenceController.java
index e32adec..49f7f21 100644
--- a/src/com/android/settings/language/PhoneLanguagePreferenceController.java
+++ b/src/com/android/settings/language/PhoneLanguagePreferenceController.java
@@ -68,8 +68,7 @@
 
     @Override
     public boolean handlePreferenceTreeClick(Preference preference) {
-        if (!InstrumentedPreferenceFragment.usePreferenceScreenTitle()
-                || !KEY_PHONE_LANGUAGE.equals(preference.getKey())) {
+        if (!KEY_PHONE_LANGUAGE.equals(preference.getKey())) {
             return false;
         }
         Utils.startWithFragment(mContext, LocaleListEditor.class.getName(), null, null, 0,
diff --git a/src/com/android/settings/nfc/AndroidBeam.java b/src/com/android/settings/nfc/AndroidBeam.java
index fcdc630..707017b 100644
--- a/src/com/android/settings/nfc/AndroidBeam.java
+++ b/src/com/android/settings/nfc/AndroidBeam.java
@@ -98,9 +98,7 @@
             mSwitchBar.show();
         }
 
-        if (usePreferenceScreenTitle()) {
-            activity.setTitle(R.string.android_beam_settings_title);
-        }
+        activity.setTitle(R.string.android_beam_settings_title);
     }
 
     @Override
diff --git a/src/com/android/settings/nfc/PaymentSettings.java b/src/com/android/settings/nfc/PaymentSettings.java
index a30cea3..c832dfc 100644
--- a/src/com/android/settings/nfc/PaymentSettings.java
+++ b/src/com/android/settings/nfc/PaymentSettings.java
@@ -63,13 +63,7 @@
         mPaymentBackend = new PaymentBackend(getActivity());
         setHasOptionsMenu(true);
 
-        final PreferenceScreen screen;
-        if (usePreferenceScreenTitle()) {
-            screen = getPreferenceScreen();
-        } else {
-            PreferenceManager manager = getPreferenceManager();
-            screen = manager.createPreferenceScreen(getActivity());
-        }
+        final PreferenceScreen screen = getPreferenceScreen();
 
         List<PaymentBackend.PaymentAppInfo> appInfos = mPaymentBackend.getPaymentAppInfos();
         if (appInfos != null && appInfos.size() > 0) {
@@ -81,9 +75,6 @@
                     mPaymentBackend);
             screen.addPreference(foreground);
         }
-        if (!usePreferenceScreenTitle()) {
-            setPreferenceScreen(screen);
-        }
     }
 
     @Override
diff --git a/src/com/android/settings/notification/ZenAccessSettings.java b/src/com/android/settings/notification/ZenAccessSettings.java
index 0a4915a..d92bc5a 100644
--- a/src/com/android/settings/notification/ZenAccessSettings.java
+++ b/src/com/android/settings/notification/ZenAccessSettings.java
@@ -77,9 +77,6 @@
         mContext = getActivity();
         mPkgMan = mContext.getPackageManager();
         mNoMan = mContext.getSystemService(NotificationManager.class);
-        if (!usePreferenceScreenTitle()) {
-            setPreferenceScreen(getPreferenceManager().createPreferenceScreen(mContext));
-        }
     }
 
     @Override
diff --git a/src/com/android/settings/widget/RadioButtonPickerFragment.java b/src/com/android/settings/widget/RadioButtonPickerFragment.java
index c768909..b3e8746 100644
--- a/src/com/android/settings/widget/RadioButtonPickerFragment.java
+++ b/src/com/android/settings/widget/RadioButtonPickerFragment.java
@@ -68,9 +68,6 @@
     @Override
     public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
         super.onCreatePreferences(savedInstanceState, rootKey);
-        if (!usePreferenceScreenTitle()) {
-            addPreferencesFromResource(R.xml.placeholder_prefs);
-        }
         updateCandidates();
     }
 
