diff --git a/src/com/android/settings/MasterClear.java b/src/com/android/settings/MasterClear.java
index bac0a61..96cc390 100644
--- a/src/com/android/settings/MasterClear.java
+++ b/src/com/android/settings/MasterClear.java
@@ -21,7 +21,7 @@
 import android.accounts.Account;
 import android.accounts.AccountManager;
 import android.accounts.AuthenticatorDescription;
-import android.annotation.StringRes;
+import android.annotation.Nullable;
 import android.app.Activity;
 import android.content.ComponentName;
 import android.content.ContentResolver;
@@ -39,7 +39,6 @@
 import android.provider.Settings;
 import android.support.annotation.VisibleForTesting;
 import android.telephony.euicc.EuiccManager;
-import android.text.TextUtils;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -54,6 +53,7 @@
 import android.widget.TextView;
 
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.password.ChooseLockSettingsHelper;
 import com.android.settings.password.ConfirmLockPattern;
 import com.android.settingslib.RestrictedLockUtils;
@@ -70,7 +70,7 @@
  *
  * This is the initial screen.
  */
-public class MasterClear extends OptionsMenuFragment {
+public class MasterClear extends InstrumentedPreferenceFragment {
     private static final String TAG = "MasterClear";
 
     private static final int KEYGUARD_REQUEST = 55;
@@ -93,9 +93,11 @@
     };
 
     @Override
-    @StringRes
-    protected int getTitle() {
-        return R.string.master_clear_title;
+    public void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        if (usePreferenceScreenTitle()) {
+            getActivity().setTitle(R.string.master_clear_title);
+        }
     }
 
     /**
diff --git a/src/com/android/settings/MasterClearConfirm.java b/src/com/android/settings/MasterClearConfirm.java
index 39bf01a..9b324c3 100644
--- a/src/com/android/settings/MasterClearConfirm.java
+++ b/src/com/android/settings/MasterClearConfirm.java
@@ -33,6 +33,7 @@
 import android.widget.TextView;
 
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settingslib.RestrictedLockUtils;
 
 import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
@@ -47,7 +48,7 @@
  *
  * This is the confirmation screen.
  */
-public class MasterClearConfirm extends OptionsMenuFragment {
+public class MasterClearConfirm extends InstrumentedPreferenceFragment {
 
     private View mContentView;
     private boolean mEraseSdCard;
diff --git a/src/com/android/settings/OptionsMenuFragment.java b/src/com/android/settings/OptionsMenuFragment.java
deleted file mode 100644
index c8dcc8e..0000000
--- a/src/com/android/settings/OptionsMenuFragment.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.settings;
-
-import android.os.Bundle;
-
-import com.android.settings.core.InstrumentedPreferenceFragment;
-
-/**
- * Base class for a fragment that has the options menu.
- * SettingsPreferenceFragment automatically sets this, but some activities do not use
- * preferences, and we need to call setHasOptionsMenu(true) for the back button on action bar.
- * For preference fragments, use SettingsPreferenceFragment.
- */
-public abstract class OptionsMenuFragment extends InstrumentedPreferenceFragment {
-
-    @Override
-    public void onActivityCreated(Bundle savedInstanceState) {
-        super.onActivityCreated(savedInstanceState);
-        setHasOptionsMenu(true);
-    }
-}
diff --git a/src/com/android/settings/ResetNetwork.java b/src/com/android/settings/ResetNetwork.java
index b5b8a18..dc89d05 100644
--- a/src/com/android/settings/ResetNetwork.java
+++ b/src/com/android/settings/ResetNetwork.java
@@ -16,7 +16,7 @@
 
 package com.android.settings;
 
-import android.annotation.StringRes;
+import android.annotation.Nullable;
 import android.app.Activity;
 import android.content.Intent;
 import android.content.res.Resources;
@@ -35,6 +35,7 @@
 
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.internal.telephony.PhoneConstants;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.password.ChooseLockSettingsHelper;
 import com.android.settings.password.ConfirmLockPattern;
 import com.android.settingslib.RestrictedLockUtils;
@@ -52,7 +53,7 @@
  *
  * This is the initial screen.
  */
-public class ResetNetwork extends OptionsMenuFragment {
+public class ResetNetwork extends InstrumentedPreferenceFragment {
     private static final String TAG = "ResetNetwork";
 
     // Arbitrary to avoid conficts
@@ -65,9 +66,11 @@
     private Button mInitiateButton;
 
     @Override
-    @StringRes
-    protected int getTitle() {
-        return R.string.reset_network_title;
+    public void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        if (usePreferenceScreenTitle()) {
+            getActivity().setTitle(R.string.reset_network_title);
+        }
     }
 
     /**
diff --git a/src/com/android/settings/ResetNetworkConfirm.java b/src/com/android/settings/ResetNetworkConfirm.java
index f70d3c2..58b8289 100644
--- a/src/com/android/settings/ResetNetworkConfirm.java
+++ b/src/com/android/settings/ResetNetworkConfirm.java
@@ -38,6 +38,7 @@
 import com.android.ims.ImsManager;
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.internal.telephony.PhoneConstants;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settingslib.RestrictedLockUtils;
 
 import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
@@ -52,7 +53,7 @@
  *
  * This is the confirmation screen.
  */
-public class ResetNetworkConfirm extends OptionsMenuFragment {
+public class ResetNetworkConfirm extends InstrumentedPreferenceFragment {
 
     private View mContentView;
     private int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
diff --git a/src/com/android/settings/TrustedCredentialsSettings.java b/src/com/android/settings/TrustedCredentialsSettings.java
index 12524b9..479a914 100644
--- a/src/com/android/settings/TrustedCredentialsSettings.java
+++ b/src/com/android/settings/TrustedCredentialsSettings.java
@@ -20,7 +20,6 @@
 import static android.widget.LinearLayout.LayoutParams.WRAP_CONTENT;
 
 import android.animation.LayoutTransition;
-import android.annotation.StringRes;
 import android.annotation.UiThread;
 import android.app.Activity;
 import android.app.KeyguardManager;
@@ -66,6 +65,7 @@
 import com.android.internal.app.UnlaunchableAppActivity;
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.internal.widget.LockPatternUtils;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 
 import java.security.cert.CertificateEncodingException;
 import java.security.cert.X509Certificate;
@@ -75,7 +75,7 @@
 import java.util.Set;
 import java.util.function.IntConsumer;
 
-public class TrustedCredentialsSettings extends OptionsMenuFragment
+public class TrustedCredentialsSettings extends InstrumentedPreferenceFragment
         implements TrustedCredentialsDialogBuilder.DelegateInterface {
 
     public static final String ARG_SHOW_NEW_FOR_USER = "ARG_SHOW_NEW_FOR_USER";
@@ -92,12 +92,6 @@
     private static final int REQUEST_CONFIRM_CREDENTIALS = 1;
 
     @Override
-    @StringRes
-    protected int getTitle() {
-        return R.string.trusted_credentials;
-    }
-
-    @Override
     public int getMetricsCategory() {
         return MetricsEvent.TRUSTED_CREDENTIALS;
     }
@@ -183,10 +177,11 @@
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        mUserManager = (UserManager) getActivity().getSystemService(Context.USER_SERVICE);
-        mKeyguardManager = (KeyguardManager) getActivity()
+        final Activity activity = getActivity();
+        mUserManager = (UserManager) activity.getSystemService(Context.USER_SERVICE);
+        mKeyguardManager = (KeyguardManager) activity
                 .getSystemService(Context.KEYGUARD_SERVICE);
-        mTrustAllCaUserId = getActivity().getIntent().getIntExtra(ARG_SHOW_NEW_FOR_USER,
+        mTrustAllCaUserId = activity.getIntent().getIntExtra(ARG_SHOW_NEW_FOR_USER,
                 UserHandle.USER_NULL);
         mConfirmedCredentialUsers = new ArraySet<>(2);
         mConfirmingCredentialUser = UserHandle.USER_NULL;
@@ -206,7 +201,11 @@
         filter.addAction(Intent.ACTION_MANAGED_PROFILE_AVAILABLE);
         filter.addAction(Intent.ACTION_MANAGED_PROFILE_UNAVAILABLE);
         filter.addAction(Intent.ACTION_MANAGED_PROFILE_UNLOCKED);
-        getActivity().registerReceiver(mWorkProfileChangedReceiver, filter);
+        activity.registerReceiver(mWorkProfileChangedReceiver, filter);
+
+        if (usePreferenceScreenTitle()) {
+            activity.setTitle(R.string.trusted_credentials);
+        }
     }
 
     @Override
diff --git a/src/com/android/settings/UserCredentialsSettings.java b/src/com/android/settings/UserCredentialsSettings.java
index f34b7a7..f8966a5 100644
--- a/src/com/android/settings/UserCredentialsSettings.java
+++ b/src/com/android/settings/UserCredentialsSettings.java
@@ -18,7 +18,6 @@
 
 import android.annotation.LayoutRes;
 import android.annotation.Nullable;
-import android.annotation.StringRes;
 import android.app.AlertDialog;
 import android.app.Dialog;
 import android.app.DialogFragment;
@@ -86,9 +85,11 @@
     }
 
     @Override
-    @StringRes
-    protected int getTitle() {
-        return R.string.user_credentials;
+    public void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        if (usePreferenceScreenTitle()) {
+            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 0fbf5fa..91cde7e 100644
--- a/src/com/android/settings/accessibility/AccessibilitySettings.java
+++ b/src/com/android/settings/accessibility/AccessibilitySettings.java
@@ -119,6 +119,7 @@
     static final String EXTRA_PREFERENCE_KEY = "preference_key";
     static final String EXTRA_CHECKED = "checked";
     static final String EXTRA_TITLE = "title";
+    static final String EXTRA_TITLE_RES = "title_res";
     static final String EXTRA_RESOLVE_INFO = "resolve_info";
     static final String EXTRA_SUMMARY = "summary";
     static final String EXTRA_SETTINGS_TITLE = "settings_title";
diff --git a/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java b/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
index 9715559..7ad4d41 100644
--- a/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
@@ -141,6 +141,10 @@
                 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.putCharSequence(AccessibilitySettings.EXTRA_SUMMARY,
                 getActivity().getResources().getText(
                         R.string.accessibility_screen_magnification_navbar_summary));
@@ -190,6 +194,10 @@
                 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.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/ToggleFeaturePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
index 213e585..bb2959f 100644
--- a/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
@@ -21,16 +21,8 @@
 import android.os.Bundle;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceScreen;
-import android.support.v7.preference.PreferenceViewHolder;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
 import android.view.View;
-import android.view.accessibility.AccessibilityEvent;
-import android.view.accessibility.AccessibilityManager;
-import android.widget.TextView;
 
-import com.android.settings.R;
 import com.android.settings.SettingsActivity;
 import com.android.settings.SettingsPreferenceFragment;
 import com.android.settings.widget.SwitchBar;
@@ -104,13 +96,6 @@
         // Implement this to reset a checked listener.
     }
 
-    /**
-     * Get the res id for static preference xml for this fragment.
-     */
-    protected int getPreferenceScreenResId() {
-        return -1;
-    }
-
     private void installActionBarToggleSwitch() {
         mSwitchBar.show();
         onInstallSwitchBarToggleSwitch();
diff --git a/src/com/android/settings/accessibility/ToggleFontSizePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleFontSizePreferenceFragment.java
index dbd269a..3e1e732 100644
--- a/src/com/android/settings/accessibility/ToggleFontSizePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleFontSizePreferenceFragment.java
@@ -17,7 +17,6 @@
 package com.android.settings.accessibility;
 
 import android.annotation.Nullable;
-import android.annotation.StringRes;
 import android.content.ContentResolver;
 import android.content.res.Configuration;
 import android.content.res.Resources;
@@ -53,12 +52,9 @@
         for (int i = 0; i < strEntryValues.length; ++i) {
             mValues[i] = Float.parseFloat(strEntryValues[i]);
         }
-    }
-
-    @Override
-    @StringRes
-    protected int getTitle() {
-        return R.string.title_font_size;
+        if (usePreferenceScreenTitle()) {
+            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 033d81b..9bc20b5 100644
--- a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
@@ -217,6 +217,14 @@
         if (arguments.containsKey(AccessibilitySettings.EXTRA_CHECKED)) {
             mInitialSetting = arguments.getBoolean(AccessibilitySettings.EXTRA_CHECKED);
         }
+
+        if (usePreferenceScreenTitle()
+                && arguments.containsKey(AccessibilitySettings.EXTRA_TITLE_RES)) {
+            final int titleRes = arguments.getInt(AccessibilitySettings.EXTRA_TITLE_RES);
+            if (titleRes > 0) {
+                getActivity().setTitle(titleRes);
+            }
+        }
     }
 
     private void updateConfigurationWarningIfNeeded() {
diff --git a/src/com/android/settings/applications/BackgroundCheckSummary.java b/src/com/android/settings/applications/BackgroundCheckSummary.java
index 1b8a787..4be3396 100644
--- a/src/com/android/settings/applications/BackgroundCheckSummary.java
+++ b/src/com/android/settings/applications/BackgroundCheckSummary.java
@@ -16,7 +16,7 @@
 
 package com.android.settings.applications;
 
-import android.annotation.StringRes;
+import android.annotation.Nullable;
 import android.app.FragmentTransaction;
 import android.os.Bundle;
 import android.preference.PreferenceFrameLayout;
@@ -38,6 +38,14 @@
     }
 
     @Override
+    public void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        if (usePreferenceScreenTitle()) {
+            getActivity().setTitle(R.string.background_check_pref);
+        }
+    }
+
+    @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
         // initialize the inflater
         mInflater = inflater;
@@ -59,10 +67,4 @@
         return rootView;
     }
 
-    @Override
-    @StringRes
-    protected int getTitle() {
-        return R.string.background_check_pref;
-    }
-
 }
diff --git a/src/com/android/settings/applications/RunningServices.java b/src/com/android/settings/applications/RunningServices.java
index c79b704..dd8f278 100644
--- a/src/com/android/settings/applications/RunningServices.java
+++ b/src/com/android/settings/applications/RunningServices.java
@@ -15,7 +15,6 @@
  */
 package com.android.settings.applications;
 
-import android.annotation.StringRes;
 import android.os.Bundle;
 import android.view.LayoutInflater;
 import android.view.Menu;
@@ -44,6 +43,10 @@
         super.onCreate(savedInstanceState);
 
         setHasOptionsMenu(true);
+
+        if (usePreferenceScreenTitle()) {
+            getActivity().setTitle(R.string.runningservices_settings_title);
+        }
     }
 
     @Override
@@ -110,12 +113,6 @@
     }
 
     @Override
-    @StringRes
-    protected int getTitle() {
-        return R.string.runningservices_settings_title;
-    }
-
-    @Override
     public int getMetricsCategory() {
         return MetricsEvent.RUNNING_SERVICES;
     }
diff --git a/src/com/android/settings/core/InstrumentedPreferenceFragment.java b/src/com/android/settings/core/InstrumentedPreferenceFragment.java
index 9ab1a01..8ef8c0e 100644
--- a/src/com/android/settings/core/InstrumentedPreferenceFragment.java
+++ b/src/com/android/settings/core/InstrumentedPreferenceFragment.java
@@ -16,10 +16,9 @@
 
 package com.android.settings.core;
 
-import android.annotation.Nullable;
-import android.annotation.StringRes;
 import android.content.Context;
 import android.os.Bundle;
+import android.support.annotation.VisibleForTesting;
 import android.support.annotation.XmlRes;
 import android.support.v7.preference.PreferenceScreen;
 import android.text.TextUtils;
@@ -40,7 +39,8 @@
         implements Instrumentable {
 
     private static final String TAG = "InstrumentedPrefFrag";
-    private static final String FEATURE_FLAG_USE_PREFERENCE_SCREEN_TITLE =
+    @VisibleForTesting
+    static final String FEATURE_FLAG_USE_PREFERENCE_SCREEN_TITLE =
             "settings_use_preference_screen_title";
     protected MetricsFeatureProvider mMetricsFeatureProvider;
 
@@ -57,17 +57,6 @@
     }
 
     @Override
-    public void onCreate(@Nullable Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        if (usePreferenceScreenTitle()) {
-            final int title = getTitle();
-            if (title != -1) {
-                getActivity().setTitle(title);
-            }
-        }
-    }
-
-    @Override
     public void onAttach(Context context) {
         super.onAttach(context);
         mMetricsFeatureProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider();
@@ -81,6 +70,12 @@
 
     @Override
     public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
+        if (usePreferenceScreenTitle()) {
+            final int resId = getPreferenceScreenResId();
+            if (resId > 0) {
+                addPreferencesFromResource(resId);
+            }
+        }
     }
 
     @Override
@@ -102,13 +97,9 @@
     }
 
     /**
-     * Return the resource id of the title to be used for the fragment. This is for preference
-     * fragments that do not have an explicit preference screen xml, and hence the title need to be
-     * specified separately. Do not use this method if the title is already specified in the
-     * preference screen.
+     * Get the res id for static preference xml for this fragment.
      */
-    @StringRes
-    protected int getTitle() {
+    protected int getPreferenceScreenResId() {
         return -1;
     }
 
diff --git a/src/com/android/settings/dashboard/DashboardFragment.java b/src/com/android/settings/dashboard/DashboardFragment.java
index 53a51cd..84fc4ce 100644
--- a/src/com/android/settings/dashboard/DashboardFragment.java
+++ b/src/com/android/settings/dashboard/DashboardFragment.java
@@ -115,7 +115,6 @@
 
     @Override
     public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
-        super.onCreatePreferences(savedInstanceState, rootKey);
         refreshAllPreferences(getLogTag());
     }
 
@@ -212,11 +211,6 @@
     protected abstract String getLogTag();
 
     /**
-     * Get the res id for static preference xml for this fragment.
-     */
-    protected abstract int getPreferenceScreenResId();
-
-    /**
      * Get a list of {@link AbstractPreferenceController} for this fragment.
      */
     protected abstract List<AbstractPreferenceController> getPreferenceControllers(Context context);
diff --git a/src/com/android/settings/display/ScreenZoomSettings.java b/src/com/android/settings/display/ScreenZoomSettings.java
index ab92155..f9a23c7 100644
--- a/src/com/android/settings/display/ScreenZoomSettings.java
+++ b/src/com/android/settings/display/ScreenZoomSettings.java
@@ -17,7 +17,6 @@
 package com.android.settings.display;
 
 import android.annotation.Nullable;
-import android.annotation.StringRes;
 import android.content.Context;
 import android.content.res.Configuration;
 import android.content.res.Resources;
@@ -71,6 +70,10 @@
             mInitialIndex = initialIndex;
             mDefaultDensity = density.getDefaultDensity();
         }
+
+        if (usePreferenceScreenTitle()) {
+            getActivity().setTitle(R.string.screen_zoom_title);
+        }
     }
 
     @Override
@@ -100,12 +103,6 @@
     }
 
     @Override
-    @StringRes
-    protected int getTitle() {
-        return R.string.screen_zoom_title;
-    }
-
-    @Override
     public int getMetricsCategory() {
         return MetricsEvent.DISPLAY_SCREEN_ZOOM;
     }
diff --git a/src/com/android/settings/language/PhoneLanguagePreferenceController.java b/src/com/android/settings/language/PhoneLanguagePreferenceController.java
index e7b0c72..e32adec 100644
--- a/src/com/android/settings/language/PhoneLanguagePreferenceController.java
+++ b/src/com/android/settings/language/PhoneLanguagePreferenceController.java
@@ -19,7 +19,12 @@
 import android.content.Context;
 import android.support.v7.preference.Preference;
 
+import com.android.internal.logging.nano.MetricsProto;
+import com.android.settings.R;
+import com.android.settings.Utils;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.core.PreferenceControllerMixin;
+import com.android.settings.localepicker.LocaleListEditor;
 import com.android.settings.overlay.FeatureFactory;
 import com.android.settingslib.core.AbstractPreferenceController;
 
@@ -60,4 +65,17 @@
     public String getPreferenceKey() {
         return KEY_PHONE_LANGUAGE;
     }
+
+    @Override
+    public boolean handlePreferenceTreeClick(Preference preference) {
+        if (!InstrumentedPreferenceFragment.usePreferenceScreenTitle()
+                || !KEY_PHONE_LANGUAGE.equals(preference.getKey())) {
+            return false;
+        }
+        Utils.startWithFragment(mContext, LocaleListEditor.class.getName(), null, null, 0,
+                R.string.pref_title_lang_selection, null,
+                MetricsProto.MetricsEvent.SETTINGS_LANGUAGE_CATEGORY);
+        return true;
+    }
+
 }
diff --git a/src/com/android/settings/localepicker/LocaleListEditor.java b/src/com/android/settings/localepicker/LocaleListEditor.java
index 9590545..165be90 100644
--- a/src/com/android/settings/localepicker/LocaleListEditor.java
+++ b/src/com/android/settings/localepicker/LocaleListEditor.java
@@ -77,8 +77,6 @@
         final View result = super.onCreateView(inflater, container, savedInstState);
         final View myLayout = inflater.inflate(R.layout.locale_order_list, (ViewGroup) result);
 
-        getActivity().setTitle(R.string.pref_title_lang_selection);
-
         configureDragAndDrop(myLayout);
         return result;
     }
diff --git a/src/com/android/settings/nfc/AndroidBeam.java b/src/com/android/settings/nfc/AndroidBeam.java
index e40fc21..fcdc630 100644
--- a/src/com/android/settings/nfc/AndroidBeam.java
+++ b/src/com/android/settings/nfc/AndroidBeam.java
@@ -16,7 +16,6 @@
 
 package com.android.settings.nfc;
 
-import android.annotation.StringRes;
 import android.nfc.NfcAdapter;
 import android.os.Bundle;
 import android.os.UserHandle;
@@ -98,6 +97,10 @@
             mSwitchBar.setEnabled(!mBeamDisallowedByBase);
             mSwitchBar.show();
         }
+
+        if (usePreferenceScreenTitle()) {
+            activity.setTitle(R.string.android_beam_settings_title);
+        }
     }
 
     @Override
@@ -131,10 +134,4 @@
     public int getMetricsCategory() {
         return MetricsEvent.NFC_BEAM;
     }
-
-    @Override
-    @StringRes
-    protected int getTitle() {
-        return R.string.android_beam_settings_title;
-    }
 }
diff --git a/src/com/android/settings/notification/EmptyTextSettings.java b/src/com/android/settings/notification/EmptyTextSettings.java
index 2b5998e..3f8ccc6 100644
--- a/src/com/android/settings/notification/EmptyTextSettings.java
+++ b/src/com/android/settings/notification/EmptyTextSettings.java
@@ -32,17 +32,6 @@
     private TextView mEmpty;
 
     @Override
-    public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
-        super.onCreatePreferences(savedInstanceState, rootKey);
-        if (usePreferenceScreenTitle()) {
-            final int resId = getPreferenceScreenResId();
-            if (resId > 0) {
-                addPreferencesFromResource(resId);
-            }
-        }
-    }
-
-    @Override
     public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
         super.onViewCreated(view, savedInstanceState);
         mEmpty = new TextView(getContext());
@@ -58,9 +47,4 @@
     protected void setEmptyText(int text) {
         mEmpty.setText(text);
     }
-
-    /**
-     * Get the res id for static preference xml for this fragment.
-     */
-    protected abstract int getPreferenceScreenResId();
 }
diff --git a/src/com/android/settings/password/ConfirmDeviceCredentialBaseFragment.java b/src/com/android/settings/password/ConfirmDeviceCredentialBaseFragment.java
index 2cb337b..350fc76 100644
--- a/src/com/android/settings/password/ConfirmDeviceCredentialBaseFragment.java
+++ b/src/com/android/settings/password/ConfirmDeviceCredentialBaseFragment.java
@@ -50,15 +50,15 @@
 import android.widget.TextView;
 
 import com.android.internal.widget.LockPatternUtils;
-import com.android.settings.OptionsMenuFragment;
 import com.android.settings.R;
 import com.android.settings.Utils;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.fingerprint.FingerprintUiHelper;
 
 /**
  * Base fragment to be shared for PIN/Pattern/Password confirmation fragments.
  */
-public abstract class ConfirmDeviceCredentialBaseFragment extends OptionsMenuFragment
+public abstract class ConfirmDeviceCredentialBaseFragment extends InstrumentedPreferenceFragment
         implements FingerprintUiHelper.Callback {
 
     public static final String PACKAGE = "com.android.settings";
diff --git a/src/com/android/settings/widget/RadioButtonPickerFragment.java b/src/com/android/settings/widget/RadioButtonPickerFragment.java
index f1df0a5..e446340 100644
--- a/src/com/android/settings/widget/RadioButtonPickerFragment.java
+++ b/src/com/android/settings/widget/RadioButtonPickerFragment.java
@@ -67,10 +67,7 @@
     @Override
     public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
         super.onCreatePreferences(savedInstanceState, rootKey);
-        final int resId = getPreferenceScreenResId();
-        if (usePreferenceScreenTitle() && resId > 0) {
-            addPreferencesFromResource(resId);
-        } else {
+        if (!usePreferenceScreenTitle()) {
             addPreferencesFromResource(R.xml.placeholder_prefs);
         }
         updateCandidates();
@@ -116,13 +113,6 @@
     }
 
     /**
-     * Get the res id for static preference xml for this fragment.
-     */
-    protected int getPreferenceScreenResId() {
-        return -1;
-    }
-
-    /**
      * A chance for subclasses to bind additional things to the preference.
      */
     @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
diff --git a/tests/robotests/src/com/android/settings/core/InstrumentedPreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/core/InstrumentedPreferenceFragmentTest.java
new file mode 100644
index 0000000..ab7228c
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/core/InstrumentedPreferenceFragmentTest.java
@@ -0,0 +1,150 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.settings.core;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.support.v7.preference.PreferenceManager;
+import android.support.v7.preference.PreferenceScreen;
+import android.util.FeatureFlagUtils;
+
+import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import com.android.settings.R;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
+import com.android.settings.testutils.shadow.SettingsShadowSystemProperties;
+import com.android.settings.TestConfig;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.annotation.Config;
+import org.robolectric.util.ReflectionHelpers;
+
+@RunWith(SettingsRobolectricTestRunner.class)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
+        SettingsShadowSystemProperties.class
+})
+public class InstrumentedPreferenceFragmentTest {
+
+    @Mock
+    private PreferenceScreen mScreen;
+    @Mock
+    private PreferenceManager mPreferenceManager;
+    @Mock
+    private Activity mActivity;
+
+    private InstrumentedPreferenceFragmentTestable mFragment;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        when(mPreferenceManager.getPreferenceScreen()).thenReturn(mScreen);
+
+        mFragment = spy(new InstrumentedPreferenceFragmentTestable());
+        ReflectionHelpers.setField(mFragment, "mPreferenceManager", mPreferenceManager);
+    }
+
+    @After
+    public void tearDown() {
+        SettingsShadowSystemProperties.clear();
+    }
+
+    @Test
+    public void onCreatePreferences_preferenceScreenTitleFeatureOff_shouldNotAddPreference() {
+        SettingsShadowSystemProperties.set(
+                FeatureFlagUtils.FFLAG_PREFIX + mFragment.FEATURE_FLAG_USE_PREFERENCE_SCREEN_TITLE,
+                "false");
+
+        mFragment.onCreatePreferences(Bundle.EMPTY, null /* rootKey */);
+
+        verify(mFragment, never()).addPreferencesFromResource(anyInt());
+    }
+
+    @Test
+    public void onCreatePreferences_noPreferenceScreenResId_shouldNotAddPreference() {
+        SettingsShadowSystemProperties.set(
+                FeatureFlagUtils.FFLAG_PREFIX + mFragment.FEATURE_FLAG_USE_PREFERENCE_SCREEN_TITLE,
+                "true");
+
+        mFragment.onCreatePreferences(Bundle.EMPTY, null /* rootKey */);
+
+        verify(mFragment, never()).addPreferencesFromResource(anyInt());
+    }
+
+    @Test
+    public void onCreatePreferences_gotPreferenceScreenResId_shouldAddPreferences() {
+        SettingsShadowSystemProperties.set(
+                FeatureFlagUtils.FFLAG_PREFIX + mFragment.FEATURE_FLAG_USE_PREFERENCE_SCREEN_TITLE,
+                "true");
+        mFragment.setPreferenceScreenResId(R.xml.screen_pinning_settings);
+        when(mFragment.getActivity()).thenReturn(mActivity);
+
+        mFragment.onCreatePreferences(Bundle.EMPTY, null /* rootKey */);
+
+        verify(mFragment).addPreferencesFromResource(R.xml.screen_pinning_settings);
+        verify(mActivity, never()).setTitle(any());
+    }
+
+    @Test
+    public void onCreatePreferences_gotPrefScreenResIdAndTitle_shouldAddPreferencesAndSetTitle() {
+        SettingsShadowSystemProperties.set(
+                FeatureFlagUtils.FFLAG_PREFIX + mFragment.FEATURE_FLAG_USE_PREFERENCE_SCREEN_TITLE,
+                "true");
+        mFragment.setPreferenceScreenResId(R.xml.screen_pinning_settings);
+        when(mFragment.getActivity()).thenReturn(mActivity);
+        final CharSequence title = "Test Title";
+        when(mScreen.getTitle()).thenReturn(title);
+
+        mFragment.onCreatePreferences(Bundle.EMPTY, null /* rootKey */);
+
+        verify(mFragment).addPreferencesFromResource(R.xml.screen_pinning_settings);
+        verify(mActivity).setTitle(title);
+    }
+
+    private static class InstrumentedPreferenceFragmentTestable
+            extends InstrumentedPreferenceFragment {
+
+        private int mScreenId = -1;
+
+        public InstrumentedPreferenceFragmentTestable() {
+        }
+
+        @Override
+        public int getMetricsCategory() {
+            return MetricsEvent.VIEW_UNKNOWN;
+        }
+
+        @Override
+        protected int getPreferenceScreenResId() {
+            return mScreenId;
+        }
+
+        public void setPreferenceScreenResId(int id) {
+            mScreenId = id;
+        }
+    }
+}
