Add config value to switch between Tether Settings UIs.

Adding this config value to make it easy to switch to developing
Tethering settings UI. Also, using this config value to make sure
that preferences from new AllInOneTetherSettings screen won't show up in
the search results.

Bug: 147915366
Test: make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=TetherSettingsTest
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=TetehrPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherSettingsTest

Change-Id: I8c88816a8f2b40fc219cae8d0d442454c5270b2b
diff --git a/src/com/android/settings/AllInOneTetherSettings.java b/src/com/android/settings/AllInOneTetherSettings.java
index fbf0280..1c7ea1d 100644
--- a/src/com/android/settings/AllInOneTetherSettings.java
+++ b/src/com/android/settings/AllInOneTetherSettings.java
@@ -201,7 +201,7 @@
         // Assume we are in a SettingsActivity. This is only safe because we currently use
         // SettingsActivity as base for all preference fragments.
         final SettingsActivity activity = (SettingsActivity) getActivity();
-        BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
+        final BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
         if (adapter != null) {
             adapter.getProfileProxy(activity.getApplicationContext(), mProfileServiceListener,
                     BluetoothProfile.PAN);
@@ -405,6 +405,12 @@
                 }
 
                 @Override
+                protected boolean isPageSearchEnabled(Context context) {
+                    return context.getResources().getBoolean(
+                            R.bool.config_show_all_in_one_tether_settings);
+                }
+
+                @Override
                 public List<AbstractPreferenceController> createPreferenceControllers(
                         Context context) {
                     return buildPreferenceControllers(context, null /* AllTetherSettings */);