Merge "Add entry point to Enterprise Privacy page"
diff --git a/res/xml/app_and_notification.xml b/res/xml/app_and_notification.xml
index 10d81df..b172e2a 100644
--- a/res/xml/app_and_notification.xml
+++ b/res/xml/app_and_notification.xml
@@ -17,7 +17,8 @@
 
 <PreferenceScreen
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
+    xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
+    android:title="@string/app_and_notification_dashboard_title">
 
     <Preference
         android:key="manage_perms"
diff --git a/res/xml/network_and_internet.xml b/res/xml/network_and_internet.xml
index bce5dd9..2dfb1cc 100644
--- a/res/xml/network_and_internet.xml
+++ b/res/xml/network_and_internet.xml
@@ -16,7 +16,8 @@
 
 <PreferenceScreen
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
+    xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
+    android:title="@string/network_dashboard_title">
 
     <SwitchPreference
         android:key="toggle_airplane"
diff --git a/res/xml/pick_up_gesture_settings.xml b/res/xml/pick_up_gesture_settings.xml
index 4ef81a2..6b67e64 100644
--- a/res/xml/pick_up_gesture_settings.xml
+++ b/res/xml/pick_up_gesture_settings.xml
@@ -15,8 +15,9 @@
   limitations under the License.
   -->
 
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
-                  xmlns:app="http://schemas.android.com/apk/res-auto">
+<PreferenceScreen
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <com.android.settings.widget.VideoPreference
         android:key="gesture_pick_up_video"
diff --git a/res/xml/user_and_accounts_settings.xml b/res/xml/user_and_accounts_settings.xml
index 73b574f..9bb39f6 100644
--- a/res/xml/user_and_accounts_settings.xml
+++ b/res/xml/user_and_accounts_settings.xml
@@ -14,10 +14,11 @@
      limitations under the License.
 -->
 
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
-                  xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
-        android:title="@string/account_settings_title"
-        settings:keywords="@string/keywords_accounts">
+<PreferenceScreen
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
+    android:title="@string/account_dashboard_title"
+    settings:keywords="@string/keywords_accounts">
 
     <Preference
         android:key="emergency_info"
@@ -33,7 +34,7 @@
     <SwitchPreference
         android:key="auto_sync_account_data"
         android:title="@string/auto_sync_account_title"
-        android:order="102" />
+        android:order="102"/>
 
     <SwitchPreference
         android:key="auto_sync_work_account_data"
@@ -53,7 +54,7 @@
         android:order="105"/>
 
     <PreferenceCategory
-      android:key="dashboard_tile_placeholder"
-      android:order="200"/>
+        android:key="dashboard_tile_placeholder"
+        android:order="200"/>
 
 </PreferenceScreen>
diff --git a/src/com/android/settings/ChooseLockPassword.java b/src/com/android/settings/ChooseLockPassword.java
index 3c66b7e..351c2a2 100644
--- a/src/com/android/settings/ChooseLockPassword.java
+++ b/src/com/android/settings/ChooseLockPassword.java
@@ -51,7 +51,7 @@
 import com.android.internal.widget.LockPatternUtils;
 import com.android.internal.widget.LockPatternUtils.RequestThrottledException;
 import com.android.internal.widget.TextViewInputDisabler;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.notification.RedactionInterstitial;
 import com.android.settings.password.PasswordRequirementAdapter;
 import com.android.setupwizardlib.GlifLayout;
@@ -157,7 +157,7 @@
         layout.setFitsSystemWindows(false);
     }
 
-    public static class ChooseLockPasswordFragment extends InstrumentedFragment
+    public static class ChooseLockPasswordFragment extends InstrumentedPreferenceFragment
             implements OnClickListener, OnEditorActionListener, TextWatcher,
             SaveAndFinishWorker.Listener {
         private static final String KEY_FIRST_PIN = "first_pin";
diff --git a/src/com/android/settings/ChooseLockPattern.java b/src/com/android/settings/ChooseLockPattern.java
index d92e6aa..4afeae0 100644
--- a/src/com/android/settings/ChooseLockPattern.java
+++ b/src/com/android/settings/ChooseLockPattern.java
@@ -37,7 +37,7 @@
 import com.android.internal.widget.LockPatternView;
 import com.android.internal.widget.LockPatternView.Cell;
 import com.android.internal.widget.LockPatternView.DisplayMode;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.notification.RedactionInterstitial;
 import com.android.setupwizardlib.GlifLayout;
 import com.google.android.collect.Lists;
@@ -127,7 +127,7 @@
         return super.onKeyDown(keyCode, event);
     }
 
-    public static class ChooseLockPatternFragment extends InstrumentedFragment
+    public static class ChooseLockPatternFragment extends InstrumentedPreferenceFragment
             implements View.OnClickListener, SaveAndFinishWorker.Listener {
 
         public static final int CONFIRM_EXISTING_REQUEST = 55;
diff --git a/src/com/android/settings/CryptKeeperConfirm.java b/src/com/android/settings/CryptKeeperConfirm.java
index e12ebe0..d61fd98 100644
--- a/src/com/android/settings/CryptKeeperConfirm.java
+++ b/src/com/android/settings/CryptKeeperConfirm.java
@@ -35,11 +35,11 @@
 
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.internal.widget.LockPatternUtils;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 
 import java.util.Locale;
 
-public class CryptKeeperConfirm extends InstrumentedFragment {
+public class CryptKeeperConfirm extends InstrumentedPreferenceFragment {
 
     private static final String TAG = "CryptKeeperConfirm";
 
diff --git a/src/com/android/settings/CryptKeeperSettings.java b/src/com/android/settings/CryptKeeperSettings.java
index cdeb55f..d9b98f0 100644
--- a/src/com/android/settings/CryptKeeperSettings.java
+++ b/src/com/android/settings/CryptKeeperSettings.java
@@ -36,9 +36,9 @@
 import android.widget.Button;
 
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 
-public class CryptKeeperSettings extends InstrumentedFragment {
+public class CryptKeeperSettings extends InstrumentedPreferenceFragment {
     private static final String TAG = "CryptKeeper";
     private static final String TYPE = "type";
     private static final String PASSWORD = "password";
diff --git a/src/com/android/settings/OptionsMenuFragment.java b/src/com/android/settings/OptionsMenuFragment.java
index d1e3db2..c8dcc8e 100644
--- a/src/com/android/settings/OptionsMenuFragment.java
+++ b/src/com/android/settings/OptionsMenuFragment.java
@@ -17,7 +17,7 @@
 
 import android.os.Bundle;
 
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 
 /**
  * Base class for a fragment that has the options menu.
@@ -25,7 +25,7 @@
  * 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 InstrumentedFragment {
+public abstract class OptionsMenuFragment extends InstrumentedPreferenceFragment {
 
     @Override
     public void onActivityCreated(Bundle savedInstanceState) {
diff --git a/src/com/android/settings/ProxySelector.java b/src/com/android/settings/ProxySelector.java
index b272637..a72525c 100644
--- a/src/com/android/settings/ProxySelector.java
+++ b/src/com/android/settings/ProxySelector.java
@@ -41,9 +41,9 @@
 
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.settings.SettingsPreferenceFragment.SettingsDialogFragment;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 
-public class ProxySelector extends InstrumentedFragment implements DialogCreatable {
+public class ProxySelector extends InstrumentedPreferenceFragment implements DialogCreatable {
     private static final String TAG = "ProxySelector";
 
     EditText    mHostnameField;
diff --git a/src/com/android/settings/SettingsPreferenceFragment.java b/src/com/android/settings/SettingsPreferenceFragment.java
index 8118dab..5f42579 100644
--- a/src/com/android/settings/SettingsPreferenceFragment.java
+++ b/src/com/android/settings/SettingsPreferenceFragment.java
@@ -45,7 +45,7 @@
 import android.widget.Button;
 
 import com.android.settings.applications.LayoutPreference;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.core.instrumentation.Instrumentable;
 import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
 import com.android.settingslib.HelpUtils;
@@ -55,7 +55,7 @@
 /**
  * Base class for Settings fragments, with some helper functions and dialog management.
  */
-public abstract class SettingsPreferenceFragment extends InstrumentedFragment
+public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceFragment
         implements DialogCreatable {
 
     /**
diff --git a/src/com/android/settings/accounts/UserAndAccountDashboardFragment.java b/src/com/android/settings/accounts/UserAndAccountDashboardFragment.java
index 4808837..4113152 100644
--- a/src/com/android/settings/accounts/UserAndAccountDashboardFragment.java
+++ b/src/com/android/settings/accounts/UserAndAccountDashboardFragment.java
@@ -16,19 +16,20 @@
 package com.android.settings.accounts;
 
 import android.content.Context;
-
 import android.os.Bundle;
-import android.support.v7.preference.Preference;
-import android.util.ArraySet;
+import android.provider.SearchIndexableResource;
+
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.settings.R;
 import com.android.settings.core.PreferenceController;
 import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.overlay.FeatureFactory;
+import com.android.settings.search.BaseSearchIndexProvider;
 import com.android.settingslib.drawer.CategoryKey;
-
 import com.android.settingslib.drawer.Tile;
+
 import java.util.ArrayList;
-import java.util.HashMap;
+import java.util.Arrays;
 import java.util.List;
 
 import static android.provider.Settings.EXTRA_AUTHORITIES;
@@ -37,7 +38,6 @@
 
     private static final String TAG = "UserAndAccountDashboard";
     private static final String METADATA_IA_ACCOUNT = "com.android.settings.ia.account";
-    private HashMap<String, ArraySet<Preference>> mAccountTiles = new HashMap<>();
 
     @Override
     public int getMetricsCategory() {
@@ -72,7 +72,7 @@
         controllers.add(new AutoSyncWorkDataPreferenceController(context, this));
         String[] authorities = getIntent().getStringArrayExtra(EXTRA_AUTHORITIES);
         final AccountPreferenceController accountPrefController =
-            new AccountPreferenceController(context, this, authorities);
+                new AccountPreferenceController(context, this, authorities);
         getLifecycle().addObserver(accountPrefController);
         controllers.add(accountPrefController);
         return controllers;
@@ -87,4 +87,18 @@
         return true;
     }
 
+    public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+            new BaseSearchIndexProvider() {
+                @Override
+                public List<SearchIndexableResource> getXmlResourcesToIndex(
+                        Context context, boolean enabled) {
+                    if (!FeatureFactory.getFactory(context).getDashboardFeatureProvider(context)
+                            .isEnabled()) {
+                        return null;
+                    }
+                    final SearchIndexableResource sir = new SearchIndexableResource(context);
+                    sir.xmlResId = R.xml.user_and_accounts_settings;
+                    return Arrays.asList(sir);
+                }
+            };
 }
\ No newline at end of file
diff --git a/src/com/android/settings/applications/AppAndNotificationDashboardFragment.java b/src/com/android/settings/applications/AppAndNotificationDashboardFragment.java
index 8630541..45b472a 100644
--- a/src/com/android/settings/applications/AppAndNotificationDashboardFragment.java
+++ b/src/com/android/settings/applications/AppAndNotificationDashboardFragment.java
@@ -17,12 +17,16 @@
 package com.android.settings.applications;
 
 import android.content.Context;
+import android.provider.SearchIndexableResource;
 
 import com.android.settings.R;
 import com.android.settings.core.PreferenceController;
 import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.overlay.FeatureFactory;
+import com.android.settings.search.BaseSearchIndexProvider;
 import com.android.settingslib.drawer.CategoryKey;
 
+import java.util.Arrays;
 import java.util.List;
 
 public class AppAndNotificationDashboardFragment extends DashboardFragment {
@@ -53,4 +57,19 @@
     protected List<PreferenceController> getPreferenceControllers(Context context) {
         return null;
     }
+
+    public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+            new BaseSearchIndexProvider() {
+                @Override
+                public List<SearchIndexableResource> getXmlResourcesToIndex(
+                        Context context, boolean enabled) {
+                    if (!FeatureFactory.getFactory(context).getDashboardFeatureProvider(context)
+                            .isEnabled()) {
+                        return null;
+                    }
+                    final SearchIndexableResource sir = new SearchIndexableResource(context);
+                    sir.xmlResId = R.xml.app_and_notification;
+                    return Arrays.asList(sir);
+                }
+            };
 }
diff --git a/src/com/android/settings/applications/AppOpsDetails.java b/src/com/android/settings/applications/AppOpsDetails.java
index ba60302..e6c040b 100644
--- a/src/com/android/settings/applications/AppOpsDetails.java
+++ b/src/com/android/settings/applications/AppOpsDetails.java
@@ -39,14 +39,14 @@
 import android.widget.TextView;
 
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.R;
 import com.android.settings.SettingsActivity;
 import com.android.settings.Utils;
 
 import java.util.List;
 
-public class AppOpsDetails extends InstrumentedFragment {
+public class AppOpsDetails extends InstrumentedPreferenceFragment {
     static final String TAG = "AppOpsDetails";
 
     public static final String ARG_PACKAGE_NAME = "package";
diff --git a/src/com/android/settings/applications/AppOpsSummary.java b/src/com/android/settings/applications/AppOpsSummary.java
index ac0a856..ba2a3c9 100644
--- a/src/com/android/settings/applications/AppOpsSummary.java
+++ b/src/com/android/settings/applications/AppOpsSummary.java
@@ -29,10 +29,10 @@
 import android.view.ViewGroup;
 
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.R;
 
-public class AppOpsSummary extends InstrumentedFragment {
+public class AppOpsSummary extends InstrumentedPreferenceFragment {
     // layout inflater object used to inflate views
     private LayoutInflater mInflater;
     
diff --git a/src/com/android/settings/applications/BackgroundCheckSummary.java b/src/com/android/settings/applications/BackgroundCheckSummary.java
index 1ff43c8..dd5c89c 100644
--- a/src/com/android/settings/applications/BackgroundCheckSummary.java
+++ b/src/com/android/settings/applications/BackgroundCheckSummary.java
@@ -24,10 +24,10 @@
 import android.view.ViewGroup;
 
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.R;
 
-public class BackgroundCheckSummary extends InstrumentedFragment {
+public class BackgroundCheckSummary extends InstrumentedPreferenceFragment {
     // layout inflater object used to inflate views
     private LayoutInflater mInflater;
 
diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java
index 0ec9f1b..37b4b96 100644
--- a/src/com/android/settings/applications/ManageApplications.java
+++ b/src/com/android/settings/applications/ManageApplications.java
@@ -67,7 +67,7 @@
 import com.android.settings.Utils;
 import com.android.settings.applications.AppStateAppOpsBridge.PermissionState;
 import com.android.settings.applications.AppStateUsageBridge.UsageState;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.dashboard.SummaryLoader;
 import com.android.settings.fuelgauge.HighPowerDetail;
 import com.android.settings.fuelgauge.PowerWhitelistBackend;
@@ -95,7 +95,7 @@
  * can be launched through Settings or via the ACTION_MANAGE_PACKAGE_STORAGE
  * intent.
  */
-public class ManageApplications extends InstrumentedFragment
+public class ManageApplications extends InstrumentedPreferenceFragment
         implements OnItemClickListener, OnItemSelectedListener {
 
     static final String TAG = "ManageApplications";
diff --git a/src/com/android/settings/applications/ProcessStatsMemDetail.java b/src/com/android/settings/applications/ProcessStatsMemDetail.java
index 46a707b..b38aaf6 100644
--- a/src/com/android/settings/applications/ProcessStatsMemDetail.java
+++ b/src/com/android/settings/applications/ProcessStatsMemDetail.java
@@ -26,12 +26,12 @@
 
 import com.android.internal.app.procstats.ProcessStats;
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.R;
 
 import static com.android.settings.Utils.prepareCustomPreferencesList;
 
-public class ProcessStatsMemDetail extends InstrumentedFragment {
+public class ProcessStatsMemDetail extends InstrumentedPreferenceFragment {
     public static final String EXTRA_MEM_TIMES = "mem_times";
     public static final String EXTRA_MEM_STATE_WEIGHTS = "mem_state_weights";
     public static final String EXTRA_MEM_CACHED_WEIGHT = "mem_cached_weight";
diff --git a/src/com/android/settings/applications/RunningServiceDetails.java b/src/com/android/settings/applications/RunningServiceDetails.java
index 28a8029..9a173bc 100644
--- a/src/com/android/settings/applications/RunningServiceDetails.java
+++ b/src/com/android/settings/applications/RunningServiceDetails.java
@@ -33,7 +33,7 @@
 import android.widget.TextView;
 
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.R;
 import com.android.settings.Utils;
 import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -45,7 +45,7 @@
 import java.util.ArrayList;
 import java.util.Collections;
 
-public class RunningServiceDetails extends InstrumentedFragment
+public class RunningServiceDetails extends InstrumentedPreferenceFragment
         implements RunningState.OnRefreshUiListener {
     static final String TAG = "RunningServicesDetails";
 
diff --git a/src/com/android/settings/core/InstrumentedFragment.java b/src/com/android/settings/core/InstrumentedFragment.java
index 45e855e..e55cc27 100644
--- a/src/com/android/settings/core/InstrumentedFragment.java
+++ b/src/com/android/settings/core/InstrumentedFragment.java
@@ -17,37 +17,17 @@
 package com.android.settings.core;
 
 import android.content.Context;
-import android.os.Bundle;
 
 import com.android.settings.core.instrumentation.Instrumentable;
 import com.android.settings.core.instrumentation.MetricsFeatureProvider;
 import com.android.settings.core.instrumentation.VisibilityLoggerMixin;
-import com.android.settings.core.lifecycle.ObservablePreferenceFragment;
+import com.android.settings.core.lifecycle.ObservableFragment;
 import com.android.settings.overlay.FeatureFactory;
 
-/**
- * Instrumented fragment that logs visibility state.
- */
-public abstract class InstrumentedFragment extends ObservablePreferenceFragment
-        implements Instrumentable {
+public abstract class InstrumentedFragment extends ObservableFragment implements Instrumentable {
 
     protected MetricsFeatureProvider mMetricsFeatureProvider;
 
-    // metrics placeholder value. Only use this for development.
-    protected final int PLACEHOLDER_METRIC = 10000;
-    protected final int SYSTEM_CATEGORY_FRAGMENT = PLACEHOLDER_METRIC + 1;
-    protected final int STORAGE_CATEGORY_FRAGMENT = PLACEHOLDER_METRIC + 2;
-    protected final int NETWORK_CATEGORY_FRAGMENT = PLACEHOLDER_METRIC + 3;
-    protected final int CONNECTED_DEVICE_CATEGORY_FRAGMENT = PLACEHOLDER_METRIC + 4;
-    protected final int APP_AND_NOTIFICATION_CATEGORY_FRAGMENT = PLACEHOLDER_METRIC + 5;
-    protected final int INPUT_AND_GESTURE_CATEGORY_FRAGMENT = PLACEHOLDER_METRIC + 6;
-    protected final int LANGUAGE_AND_REGION_CATEGORY_FRAGMENT = PLACEHOLDER_METRIC + 7;
-    protected final int GESTURE_SWIPE_TO_NOTIFICATION = PLACEHOLDER_METRIC + 8;
-    protected final int GESTURE_DOUBLE_TAP_POWER = PLACEHOLDER_METRIC + 9;
-    protected final int GESTURE_PICKUP = PLACEHOLDER_METRIC + 10;
-    protected final int GESTURE_DOUBLE_TAP_SCREEN = PLACEHOLDER_METRIC + 11;
-    protected final int GESTURE_DOUBLE_TWIST = PLACEHOLDER_METRIC + 12;
-
     public InstrumentedFragment() {
         // Mixin that logs visibility change for activity.
         getLifecycle().addObserver(new VisibilityLoggerMixin(getMetricsCategory()));
@@ -58,8 +38,4 @@
         super.onAttach(context);
         mMetricsFeatureProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider();
     }
-
-    @Override
-    public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
-    }
-}
+}
\ No newline at end of file
diff --git a/src/com/android/settings/core/InstrumentedPreferenceFragment.java b/src/com/android/settings/core/InstrumentedPreferenceFragment.java
new file mode 100644
index 0000000..1724d0c
--- /dev/null
+++ b/src/com/android/settings/core/InstrumentedPreferenceFragment.java
@@ -0,0 +1,65 @@
+/*
+ * 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.core;
+
+import android.content.Context;
+import android.os.Bundle;
+
+import com.android.settings.core.instrumentation.Instrumentable;
+import com.android.settings.core.instrumentation.MetricsFeatureProvider;
+import com.android.settings.core.instrumentation.VisibilityLoggerMixin;
+import com.android.settings.core.lifecycle.ObservablePreferenceFragment;
+import com.android.settings.overlay.FeatureFactory;
+
+/**
+ * Instrumented fragment that logs visibility state.
+ */
+public abstract class InstrumentedPreferenceFragment extends ObservablePreferenceFragment
+        implements Instrumentable {
+
+    protected MetricsFeatureProvider mMetricsFeatureProvider;
+
+    // metrics placeholder value. Only use this for development.
+    protected final int PLACEHOLDER_METRIC = 10000;
+    protected final int SYSTEM_CATEGORY_FRAGMENT = PLACEHOLDER_METRIC + 1;
+    protected final int STORAGE_CATEGORY_FRAGMENT = PLACEHOLDER_METRIC + 2;
+    protected final int NETWORK_CATEGORY_FRAGMENT = PLACEHOLDER_METRIC + 3;
+    protected final int CONNECTED_DEVICE_CATEGORY_FRAGMENT = PLACEHOLDER_METRIC + 4;
+    protected final int APP_AND_NOTIFICATION_CATEGORY_FRAGMENT = PLACEHOLDER_METRIC + 5;
+    protected final int INPUT_AND_GESTURE_CATEGORY_FRAGMENT = PLACEHOLDER_METRIC + 6;
+    protected final int LANGUAGE_AND_REGION_CATEGORY_FRAGMENT = PLACEHOLDER_METRIC + 7;
+    protected final int GESTURE_SWIPE_TO_NOTIFICATION = PLACEHOLDER_METRIC + 8;
+    protected final int GESTURE_DOUBLE_TAP_POWER = PLACEHOLDER_METRIC + 9;
+    protected final int GESTURE_PICKUP = PLACEHOLDER_METRIC + 10;
+    protected final int GESTURE_DOUBLE_TAP_SCREEN = PLACEHOLDER_METRIC + 11;
+    protected final int GESTURE_DOUBLE_TWIST = PLACEHOLDER_METRIC + 12;
+
+    public InstrumentedPreferenceFragment() {
+        // Mixin that logs visibility change for activity.
+        getLifecycle().addObserver(new VisibilityLoggerMixin(getMetricsCategory()));
+    }
+
+    @Override
+    public void onAttach(Context context) {
+        super.onAttach(context);
+        mMetricsFeatureProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider();
+    }
+
+    @Override
+    public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
+    }
+}
diff --git a/src/com/android/settings/core/lifecycle/ObservableFragment.java b/src/com/android/settings/core/lifecycle/ObservableFragment.java
new file mode 100644
index 0000000..b146325
--- /dev/null
+++ b/src/com/android/settings/core/lifecycle/ObservableFragment.java
@@ -0,0 +1,87 @@
+/*
+ * 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.core.lifecycle;
+
+import android.annotation.CallSuper;
+import android.app.Fragment;
+import android.content.Context;
+import android.os.Bundle;
+
+public class ObservableFragment extends Fragment {
+
+    private final Lifecycle mLifecycle = new Lifecycle();
+
+    protected Lifecycle getLifecycle() {
+        return mLifecycle;
+    }
+
+    @CallSuper
+    @Override
+    public void onAttach(Context context) {
+        super.onAttach(context);
+        mLifecycle.onAttach(context);
+    }
+
+    @CallSuper
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        mLifecycle.onCreate(savedInstanceState);
+        super.onCreate(savedInstanceState);
+    }
+
+    @CallSuper
+    @Override
+    public void onSaveInstanceState(Bundle outState) {
+        super.onSaveInstanceState(outState);
+        mLifecycle.onSaveInstanceState(outState);
+    }
+
+    @CallSuper
+    @Override
+    public void onStart() {
+        mLifecycle.onStart();
+        super.onStart();
+    }
+
+    @CallSuper
+    @Override
+    public void onStop() {
+        mLifecycle.onStop();
+        super.onStop();
+    }
+
+    @CallSuper
+    @Override
+    public void onResume() {
+        mLifecycle.onResume();
+        super.onResume();
+    }
+
+    @CallSuper
+    @Override
+    public void onPause() {
+        mLifecycle.onPause();
+        super.onPause();
+    }
+
+    @CallSuper
+    @Override
+    public void onDestroy() {
+        mLifecycle.onDestroy();
+        super.onDestroy();
+    }
+}
\ No newline at end of file
diff --git a/src/com/android/settings/dashboard/DashboardAdapter.java b/src/com/android/settings/dashboard/DashboardAdapter.java
index 3891030..8ff5607 100644
--- a/src/com/android/settings/dashboard/DashboardAdapter.java
+++ b/src/com/android/settings/dashboard/DashboardAdapter.java
@@ -25,6 +25,7 @@
 import android.support.v7.widget.RecyclerView;
 import android.text.TextUtils;
 import android.util.ArrayMap;
+import android.util.Log;
 import android.util.TypedValue;
 import android.view.ContextThemeWrapper;
 import android.view.LayoutInflater;
@@ -153,6 +154,7 @@
 
     public void setConditions(List<Condition> conditions) {
         final DashboardData prevData = mDashboardData;
+        Log.d(TAG, "adapter setConditions called");
         mDashboardData = new DashboardData.Builder(prevData)
                 .setConditions(conditions)
                 .build();
diff --git a/src/com/android/settings/dashboard/DashboardSummary.java b/src/com/android/settings/dashboard/DashboardSummary.java
index 0b3cc32..b98de22 100644
--- a/src/com/android/settings/dashboard/DashboardSummary.java
+++ b/src/com/android/settings/dashboard/DashboardSummary.java
@@ -32,7 +32,7 @@
 import com.android.settings.R;
 import com.android.settings.Settings;
 import com.android.settings.SettingsActivity;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.dashboard.conditional.Condition;
 import com.android.settings.dashboard.conditional.ConditionAdapterUtils;
 import com.android.settings.dashboard.conditional.ConditionManager;
@@ -47,7 +47,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-public class DashboardSummary extends InstrumentedFragment
+public class DashboardSummary extends InstrumentedPreferenceFragment
         implements SettingsDrawerActivity.CategoryListener, ConditionManager.ConditionListener,
         FocusRecyclerView.FocusListener {
     public static final boolean DEBUG = false;
@@ -177,9 +177,12 @@
     public void onWindowFocusChanged(boolean hasWindowFocus) {
         long startTime = System.currentTimeMillis();
         if (hasWindowFocus) {
+            Log.d(TAG, "Listening for condition changes");
             mConditionManager.addListener(this);
+            Log.d(TAG, "conditions refreshed");
             mConditionManager.refreshAll();
         } else {
+            Log.d(TAG, "Stopped listening for condition changes");
             mConditionManager.remListener(this);
         }
         if (DEBUG_TIMING) {
@@ -220,6 +223,7 @@
         mDashboard.setHasFixedSize(true);
         mDashboard.addItemDecoration(new DashboardDecorator(getContext()));
         mDashboard.setListener(this);
+        Log.d(TAG, "adapter created");
         mAdapter = new DashboardAdapter(getContext(), mSuggestionParser, mMetricsFeatureProvider,
                 bundle, mConditionManager.getConditions());
         mDashboard.setAdapter(mAdapter);
diff --git a/src/com/android/settings/dashboard/SearchResultsSummary.java b/src/com/android/settings/dashboard/SearchResultsSummary.java
index 7097485..ef84f8b 100644
--- a/src/com/android/settings/dashboard/SearchResultsSummary.java
+++ b/src/com/android/settings/dashboard/SearchResultsSummary.java
@@ -41,12 +41,12 @@
 import com.android.settings.R;
 import com.android.settings.SettingsActivity;
 import com.android.settings.Utils;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.search.Index;
 
 import java.util.HashMap;
 
-public class SearchResultsSummary extends InstrumentedFragment {
+public class SearchResultsSummary extends InstrumentedPreferenceFragment {
 
     private static final String LOG_TAG = "SearchResultsSummary";
 
diff --git a/src/com/android/settings/dashboard/conditional/AirplaneModeCondition.java b/src/com/android/settings/dashboard/conditional/AirplaneModeCondition.java
index b40baf5..37faeab 100644
--- a/src/com/android/settings/dashboard/conditional/AirplaneModeCondition.java
+++ b/src/com/android/settings/dashboard/conditional/AirplaneModeCondition.java
@@ -20,12 +20,14 @@
 import android.content.Intent;
 import android.graphics.drawable.Icon;
 import android.net.ConnectivityManager;
+import android.util.Log;
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.settings.R;
 import com.android.settings.Settings;
 import com.android.settingslib.WirelessUtils;
 
 public class AirplaneModeCondition extends Condition {
+    public static String TAG = "APM_Condition";
 
     public AirplaneModeCondition(ConditionManager conditionManager) {
         super(conditionManager);
@@ -33,6 +35,7 @@
 
     @Override
     public void refreshState() {
+        Log.d(TAG, "APM condition refreshed");
         setActive(WirelessUtils.isAirplaneModeOn(mManager.getContext()));
     }
 
@@ -47,6 +50,12 @@
     }
 
     @Override
+    protected void setActive(boolean active) {
+        super.setActive(active);
+        Log.d(TAG, "setActive was called with " + active);
+    }
+
+    @Override
     public CharSequence getTitle() {
         return mManager.getContext().getString(R.string.condition_airplane_title);
     }
diff --git a/src/com/android/settings/dashboard/conditional/ConditionAdapterUtils.java b/src/com/android/settings/dashboard/conditional/ConditionAdapterUtils.java
index c79cdf3..b58ac39 100644
--- a/src/com/android/settings/dashboard/conditional/ConditionAdapterUtils.java
+++ b/src/com/android/settings/dashboard/conditional/ConditionAdapterUtils.java
@@ -21,6 +21,7 @@
 import android.content.Context;
 import android.support.v7.widget.RecyclerView;
 import android.support.v7.widget.helper.ItemTouchHelper;
+import android.util.Log;
 import android.view.View;
 import android.view.View.OnLayoutChangeListener;
 import android.view.ViewGroup.LayoutParams;
@@ -31,8 +32,10 @@
 import com.android.settings.R;
 import com.android.settings.dashboard.DashboardAdapter;
 import com.android.settings.overlay.FeatureFactory;
+import com.android.settingslib.WirelessUtils;
 
 public class ConditionAdapterUtils {
+    private static final String TAG = "ConditionAdapterUtils";
 
     public static void addDismiss(final RecyclerView recyclerView) {
         ItemTouchHelper.SimpleCallback callback = new ItemTouchHelper.SimpleCallback(0,
@@ -65,6 +68,11 @@
     public static void bindViews(final Condition condition,
             DashboardAdapter.DashboardItemHolder view, boolean isExpanded,
             View.OnClickListener onClickListener, View.OnClickListener onExpandListener) {
+        if (condition instanceof AirplaneModeCondition) {
+            Log.d(TAG, "Airplane mode condition has been bound with "
+                    + "isActive=" + condition.isActive() + ". Airplane mode is currently " +
+                    WirelessUtils.isAirplaneModeOn(condition.mManager.getContext()));
+        }
         View card = view.itemView.findViewById(R.id.content);
         card.setTag(condition);
         card.setOnClickListener(onClickListener);
diff --git a/src/com/android/settings/dashboard/conditional/ConditionManager.java b/src/com/android/settings/dashboard/conditional/ConditionManager.java
index 691821a..030c62d 100644
--- a/src/com/android/settings/dashboard/conditional/ConditionManager.java
+++ b/src/com/android/settings/dashboard/conditional/ConditionManager.java
@@ -59,9 +59,11 @@
         mContext = context;
         mConditions = new ArrayList<>();
         if (loadConditionsNow) {
+            Log.d(TAG, "conditions loading synchronously");
             ConditionLoader loader = new ConditionLoader();
             loader.onPostExecute(loader.doInBackground());
         } else {
+            Log.d(TAG, "conditions loading asychronously");
             new ConditionLoader().execute();
         }
     }
@@ -229,6 +231,7 @@
     private class ConditionLoader extends AsyncTask<Void, Void, ArrayList<Condition>> {
         @Override
         protected ArrayList<Condition> doInBackground(Void... params) {
+            Log.d(TAG, "loading conditions from xml");
             ArrayList<Condition> conditions = new ArrayList<>();
             mXmlFile = new File(mContext.getFilesDir(), FILE_NAME);
             if (mXmlFile.exists()) {
@@ -240,6 +243,7 @@
 
         @Override
         protected void onPostExecute(ArrayList<Condition> conditions) {
+            Log.d(TAG, "conditions loaded from xml, refreshing conditions");
             mConditions.clear();
             mConditions.addAll(conditions);
             refreshAll();
diff --git a/src/com/android/settings/deviceinfo/PrivateVolumeFormat.java b/src/com/android/settings/deviceinfo/PrivateVolumeFormat.java
index c4ca880..319a09c 100644
--- a/src/com/android/settings/deviceinfo/PrivateVolumeFormat.java
+++ b/src/com/android/settings/deviceinfo/PrivateVolumeFormat.java
@@ -30,10 +30,10 @@
 import android.widget.TextView;
 
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.R;
 
-public class PrivateVolumeFormat extends InstrumentedFragment {
+public class PrivateVolumeFormat extends InstrumentedPreferenceFragment {
     private VolumeInfo mVolume;
     private DiskInfo mDisk;
 
diff --git a/src/com/android/settings/fingerprint/FingerprintEnrollSidecar.java b/src/com/android/settings/fingerprint/FingerprintEnrollSidecar.java
index c0c0d33..e0c5d65 100644
--- a/src/com/android/settings/fingerprint/FingerprintEnrollSidecar.java
+++ b/src/com/android/settings/fingerprint/FingerprintEnrollSidecar.java
@@ -28,12 +28,12 @@
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.settings.ChooseLockSettingsHelper;
 import com.android.settings.Utils;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 
 /**
  * Sidecar fragment to handle the state around fingerprint enrollment.
  */
-public class FingerprintEnrollSidecar extends InstrumentedFragment {
+public class FingerprintEnrollSidecar extends InstrumentedPreferenceFragment {
 
     private int mEnrollmentSteps = -1;
     private int mEnrollmentRemaining = 0;
diff --git a/src/com/android/settings/gestures/DoubleTapPowerSettings.java b/src/com/android/settings/gestures/DoubleTapPowerSettings.java
index 521c665..b4319f1 100644
--- a/src/com/android/settings/gestures/DoubleTapPowerSettings.java
+++ b/src/com/android/settings/gestures/DoubleTapPowerSettings.java
@@ -17,12 +17,16 @@
 package com.android.settings.gestures;
 
 import android.content.Context;
+import android.provider.SearchIndexableResource;
 
 import com.android.settings.R;
 import com.android.settings.core.PreferenceController;
 import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.overlay.FeatureFactory;
+import com.android.settings.search.BaseSearchIndexProvider;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 public class DoubleTapPowerSettings extends DashboardFragment {
@@ -55,4 +59,19 @@
         controllers.add(new DoubleTapPowerPreferenceController(context, getLifecycle()));
         return controllers;
     }
+
+    public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+            new BaseSearchIndexProvider() {
+                @Override
+                public List<SearchIndexableResource> getXmlResourcesToIndex(
+                        Context context, boolean enabled) {
+                    if (!FeatureFactory.getFactory(context).getDashboardFeatureProvider(context)
+                            .isEnabled()) {
+                        return null;
+                    }
+                    final SearchIndexableResource sir = new SearchIndexableResource(context);
+                    sir.xmlResId = R.xml.double_tap_power_settings;
+                    return Arrays.asList(sir);
+                }
+            };
 }
diff --git a/src/com/android/settings/gestures/DoubleTapScreenSettings.java b/src/com/android/settings/gestures/DoubleTapScreenSettings.java
index 3c53947..c10fbb7 100644
--- a/src/com/android/settings/gestures/DoubleTapScreenSettings.java
+++ b/src/com/android/settings/gestures/DoubleTapScreenSettings.java
@@ -18,13 +18,17 @@
 
 import android.content.Context;
 import android.os.UserHandle;
+import android.provider.SearchIndexableResource;
 
 import com.android.internal.hardware.AmbientDisplayConfiguration;
 import com.android.settings.R;
 import com.android.settings.core.PreferenceController;
 import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.overlay.FeatureFactory;
+import com.android.settings.search.BaseSearchIndexProvider;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 public class DoubleTapScreenSettings extends DashboardFragment {
@@ -58,4 +62,19 @@
                 new AmbientDisplayConfiguration(context), UserHandle.myUserId()));
         return controllers;
     }
+
+    public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+            new BaseSearchIndexProvider() {
+                @Override
+                public List<SearchIndexableResource> getXmlResourcesToIndex(
+                        Context context, boolean enabled) {
+                    if (!FeatureFactory.getFactory(context).getDashboardFeatureProvider(context)
+                            .isEnabled()) {
+                        return null;
+                    }
+                    final SearchIndexableResource sir = new SearchIndexableResource(context);
+                    sir.xmlResId = R.xml.double_tap_screen_settings;
+                    return Arrays.asList(sir);
+                }
+            };
 }
diff --git a/src/com/android/settings/gestures/DoubleTwistGestureSettings.java b/src/com/android/settings/gestures/DoubleTwistGestureSettings.java
index 07b40bb..c11f4a5 100644
--- a/src/com/android/settings/gestures/DoubleTwistGestureSettings.java
+++ b/src/com/android/settings/gestures/DoubleTwistGestureSettings.java
@@ -17,12 +17,16 @@
 package com.android.settings.gestures;
 
 import android.content.Context;
+import android.provider.SearchIndexableResource;
 
 import com.android.settings.R;
 import com.android.settings.core.PreferenceController;
 import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.overlay.FeatureFactory;
+import com.android.settings.search.BaseSearchIndexProvider;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 public class DoubleTwistGestureSettings extends DashboardFragment {
@@ -55,4 +59,19 @@
         controllers.add(new DoubleTwistPreferenceController(context, getLifecycle()));
         return controllers;
     }
+
+    public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+            new BaseSearchIndexProvider() {
+                @Override
+                public List<SearchIndexableResource> getXmlResourcesToIndex(
+                        Context context, boolean enabled) {
+                    if (!FeatureFactory.getFactory(context).getDashboardFeatureProvider(context)
+                            .isEnabled()) {
+                        return null;
+                    }
+                    final SearchIndexableResource sir = new SearchIndexableResource(context);
+                    sir.xmlResId = R.xml.double_twist_gesture_settings;
+                    return Arrays.asList(sir);
+                }
+            };
 }
diff --git a/src/com/android/settings/gestures/PickupGestureSettings.java b/src/com/android/settings/gestures/PickupGestureSettings.java
index 1298dfe..63d3968 100644
--- a/src/com/android/settings/gestures/PickupGestureSettings.java
+++ b/src/com/android/settings/gestures/PickupGestureSettings.java
@@ -18,13 +18,17 @@
 
 import android.content.Context;
 import android.os.UserHandle;
+import android.provider.SearchIndexableResource;
 
 import com.android.internal.hardware.AmbientDisplayConfiguration;
 import com.android.settings.R;
 import com.android.settings.core.PreferenceController;
 import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.overlay.FeatureFactory;
+import com.android.settings.search.BaseSearchIndexProvider;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 public class PickupGestureSettings extends DashboardFragment {
@@ -58,4 +62,20 @@
                 new AmbientDisplayConfiguration(context), UserHandle.myUserId()));
         return controllers;
     }
+
+    public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+            new BaseSearchIndexProvider() {
+                @Override
+                public List<SearchIndexableResource> getXmlResourcesToIndex(
+                        Context context, boolean enabled) {
+                    if (!FeatureFactory.getFactory(context).getDashboardFeatureProvider(context)
+                            .isEnabled()) {
+                        return null;
+                    }
+                    final SearchIndexableResource sir = new SearchIndexableResource(context);
+                    sir.xmlResId = R.xml.pick_up_gesture_settings;
+                    return Arrays.asList(sir);
+                }
+            };
+
 }
diff --git a/src/com/android/settings/gestures/SwipeToNotificationSettings.java b/src/com/android/settings/gestures/SwipeToNotificationSettings.java
index 7eeba29..57796a6 100644
--- a/src/com/android/settings/gestures/SwipeToNotificationSettings.java
+++ b/src/com/android/settings/gestures/SwipeToNotificationSettings.java
@@ -17,12 +17,16 @@
 package com.android.settings.gestures;
 
 import android.content.Context;
+import android.provider.SearchIndexableResource;
 
 import com.android.settings.R;
 import com.android.settings.core.PreferenceController;
 import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.overlay.FeatureFactory;
+import com.android.settings.search.BaseSearchIndexProvider;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 public class SwipeToNotificationSettings extends DashboardFragment {
@@ -55,4 +59,19 @@
         controllers.add(new SwipeToNotificationPreferenceController(context, getLifecycle()));
         return controllers;
     }
+
+    public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+            new BaseSearchIndexProvider() {
+                @Override
+                public List<SearchIndexableResource> getXmlResourcesToIndex(
+                        Context context, boolean enabled) {
+                    if (!FeatureFactory.getFactory(context).getDashboardFeatureProvider(context)
+                            .isEnabled()) {
+                        return null;
+                    }
+                    final SearchIndexableResource sir = new SearchIndexableResource(context);
+                    sir.xmlResId = R.xml.swipe_to_notification_settings;
+                    return Arrays.asList(sir);
+                }
+            };
 }
diff --git a/src/com/android/settings/inputmethod/UserDictionaryAddWordFragment.java b/src/com/android/settings/inputmethod/UserDictionaryAddWordFragment.java
index 65b40a3..0d30bcc 100644
--- a/src/com/android/settings/inputmethod/UserDictionaryAddWordFragment.java
+++ b/src/com/android/settings/inputmethod/UserDictionaryAddWordFragment.java
@@ -27,7 +27,7 @@
 import android.widget.ArrayAdapter;
 
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.R;
 import com.android.settings.SettingsActivity;
 import com.android.settings.inputmethod.UserDictionaryAddWordContents.LocaleRenderer;
@@ -41,7 +41,7 @@
  * As opposed to the UserDictionaryActivity, this is only invoked within Settings
  * from the UserDictionarySettings.
  */
-public class UserDictionaryAddWordFragment extends InstrumentedFragment
+public class UserDictionaryAddWordFragment extends InstrumentedPreferenceFragment
         implements AdapterView.OnItemSelectedListener,
         com.android.internal.app.LocalePicker.LocaleSelectionListener {
 
diff --git a/src/com/android/settings/network/NetworkDashboardFragment.java b/src/com/android/settings/network/NetworkDashboardFragment.java
index cb75f0e..a58a879 100644
--- a/src/com/android/settings/network/NetworkDashboardFragment.java
+++ b/src/com/android/settings/network/NetworkDashboardFragment.java
@@ -18,15 +18,19 @@
 import android.app.AlertDialog;
 import android.app.Dialog;
 import android.content.Context;
+import android.provider.SearchIndexableResource;
 import android.util.Log;
 
 import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
 import com.android.settings.core.PreferenceController;
 import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.overlay.FeatureFactory;
+import com.android.settings.search.BaseSearchIndexProvider;
 import com.android.settingslib.drawer.CategoryKey;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 import static com.android.settings.network.MobilePlanPreferenceController
@@ -107,4 +111,19 @@
         }
         return 0;
     }
+
+    public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+            new BaseSearchIndexProvider() {
+                @Override
+                public List<SearchIndexableResource> getXmlResourcesToIndex(
+                        Context context, boolean enabled) {
+                    if (!FeatureFactory.getFactory(context).getDashboardFeatureProvider(context)
+                            .isEnabled()) {
+                        return null;
+                    }
+                    final SearchIndexableResource sir = new SearchIndexableResource(context);
+                    sir.xmlResId = R.xml.network_and_internet;
+                    return Arrays.asList(sir);
+                }
+            };
 }
diff --git a/src/com/android/settings/nfc/AndroidBeam.java b/src/com/android/settings/nfc/AndroidBeam.java
index 76b67e8..fe264f3 100644
--- a/src/com/android/settings/nfc/AndroidBeam.java
+++ b/src/com/android/settings/nfc/AndroidBeam.java
@@ -29,7 +29,7 @@
 
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.settingslib.HelpUtils;
-import com.android.settings.core.InstrumentedFragment;
+import com.android.settings.core.InstrumentedPreferenceFragment;
 import com.android.settings.R;
 import com.android.settings.SettingsActivity;
 import com.android.settings.ShowAdminSupportDetailsDialog;
@@ -38,7 +38,7 @@
 
 import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
 
-public class AndroidBeam extends InstrumentedFragment
+public class AndroidBeam extends InstrumentedPreferenceFragment
         implements SwitchBar.OnSwitchChangeListener {
     private View mView;
     private NfcAdapter mNfcAdapter;
diff --git a/src/com/android/settings/search/Indexable.java b/src/com/android/settings/search/Indexable.java
index 19f88ae..e87d9dc 100644
--- a/src/com/android/settings/search/Indexable.java
+++ b/src/com/android/settings/search/Indexable.java
@@ -33,7 +33,7 @@
  */
 public interface Indexable {
 
-    public interface SearchIndexProvider {
+    interface SearchIndexProvider {
         /**
          * Return a list of references for indexing.
          *
diff --git a/src/com/android/settings/search/SearchIndexableResources.java b/src/com/android/settings/search/SearchIndexableResources.java
index 959f444..7fa302c 100644
--- a/src/com/android/settings/search/SearchIndexableResources.java
+++ b/src/com/android/settings/search/SearchIndexableResources.java
@@ -34,7 +34,9 @@
 import com.android.settings.WirelessSettings;
 import com.android.settings.accessibility.AccessibilitySettings;
 import com.android.settings.accounts.AccountSettings;
+import com.android.settings.accounts.UserAndAccountDashboardFragment;
 import com.android.settings.applications.AdvancedAppSettings;
+import com.android.settings.applications.AppAndNotificationDashboardFragment;
 import com.android.settings.applications.SpecialAccessSettings;
 import com.android.settings.bluetooth.BluetoothSettings;
 import com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment;
@@ -46,10 +48,16 @@
 import com.android.settings.enterprise.EnterprisePrivacySettings;
 import com.android.settings.fuelgauge.BatterySaverSettings;
 import com.android.settings.fuelgauge.PowerUsageSummary;
+import com.android.settings.gestures.DoubleTapPowerSettings;
+import com.android.settings.gestures.DoubleTapScreenSettings;
+import com.android.settings.gestures.DoubleTwistGestureSettings;
 import com.android.settings.gestures.GestureSettings;
+import com.android.settings.gestures.PickupGestureSettings;
+import com.android.settings.gestures.SwipeToNotificationSettings;
 import com.android.settings.inputmethod.InputMethodAndLanguageSettings;
 import com.android.settings.location.LocationSettings;
 import com.android.settings.location.ScanningSettings;
+import com.android.settings.network.NetworkDashboardFragment;
 import com.android.settings.notification.ConfigureNotificationSettings;
 import com.android.settings.notification.OtherSoundSettings;
 import com.android.settings.notification.SoundSettings;
@@ -84,6 +92,7 @@
 
     static {
         addIndex(WifiSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_wireless);
+        addIndex(NetworkDashboardFragment.class, NO_DATA_RES_ID, R.drawable.ic_settings_wireless);
         addIndex(AdvancedWifiSettings.class,
                 R.xml.wifi_advanced_settings, R.drawable.ic_settings_wireless);
         addIndex(SavedAccessPointsWifiSettings.class,
@@ -98,6 +107,8 @@
         addIndex(WallpaperTypeSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_display);
         addIndex(ConfigureNotificationSettings.class,
                 R.xml.configure_notification_settings, R.drawable.ic_settings_notifications);
+        addIndex(AppAndNotificationDashboardFragment.class, NO_DATA_RES_ID,
+                R.drawable.ic_settings_applications);
         addIndex(SoundSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_sound);
         addIndex(OtherSoundSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_sound);
         addIndex(ZenModeSettings.class,
@@ -114,11 +125,19 @@
                 R.xml.special_access, R.drawable.ic_settings_applications);
         addIndex(UserSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_multiuser);
         addIndex(GestureSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_gestures);
+        addIndex(PickupGestureSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_gestures);
+        addIndex(DoubleTapScreenSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_gestures);
+        addIndex(DoubleTapPowerSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_gestures);
+        addIndex(DoubleTwistGestureSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_gestures);
+        addIndex(SwipeToNotificationSettings.class, NO_DATA_RES_ID,
+                R.drawable.ic_settings_gestures);
         addIndex(LocationSettings.class, R.xml.location_settings, R.drawable.ic_settings_location);
         addIndex(ScanningSettings.class, R.xml.location_scanning, R.drawable.ic_settings_location);
         addIndex(SecuritySettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_security);
         addIndex(ScreenPinningSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_security);
         addIndex(AccountSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_accounts);
+        addIndex(UserAndAccountDashboardFragment.class, NO_DATA_RES_ID,
+                R.drawable.ic_settings_accounts);
         addIndex(InputMethodAndLanguageSettings.class,
                 NO_DATA_RES_ID, R.drawable.ic_settings_language);
         addIndex(PrivacySettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_backup);
diff --git a/tests/robotests/assets/grandfather_not_implementing_index_provider b/tests/robotests/assets/grandfather_not_implementing_index_provider
index 554ea3c..05cd93b 100644
--- a/tests/robotests/assets/grandfather_not_implementing_index_provider
+++ b/tests/robotests/assets/grandfather_not_implementing_index_provider
@@ -1,14 +1,5 @@
-com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment
-com.android.settings.gestures.PickupGestureSettings
 com.android.settings.notification.ConfigureNotificationSettings
 com.android.settings.language.LanguageAndRegionSettings
-com.android.settings.accounts.UserAndAccountDashboardFragment
-com.android.settings.gestures.DoubleTapScreenSettings
-com.android.settings.network.NetworkDashboardFragment
-com.android.settings.applications.AppAndNotificationDashboardFragment
-com.android.settings.gestures.SwipeToNotificationSettings
 com.android.settings.notification.ZenModePrioritySettings
-com.android.settings.gestures.DoubleTapPowerSettings
 com.android.settings.inputmethod.InputAndGestureSettings
-com.android.settings.gestures.DoubleTwistGestureSettings
 com.android.settings.accounts.AccountDetailDashboardFragment
\ No newline at end of file
diff --git a/tests/robotests/assets/grandfather_not_implementing_instrumentable b/tests/robotests/assets/grandfather_not_implementing_instrumentable
index 5bd96af..c1f0d60 100644
--- a/tests/robotests/assets/grandfather_not_implementing_instrumentable
+++ b/tests/robotests/assets/grandfather_not_implementing_instrumentable
@@ -1,4 +1,5 @@
 com.android.settings.deletionhelper.ActivationWarningFragment
 com.android.settings.core.lifecycle.ObservableDialogFragment
+com.android.settings.core.lifecycle.ObservableFragment
 com.android.settings.applications.AppOpsCategory
 com.android.settings.inputmethod.UserDictionaryLocalePicker
diff --git a/tests/robotests/src/com/android/settings/accounts/UserAndAccountDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/accounts/UserAndAccountDashboardFragmentTest.java
index 2df7e2b..90761a0 100644
--- a/tests/robotests/src/com/android/settings/accounts/UserAndAccountDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/UserAndAccountDashboardFragmentTest.java
@@ -15,19 +15,29 @@
  */
 package com.android.settings.accounts;
 
+import android.content.Context;
 import android.os.Bundle;
+import android.provider.SearchIndexableResource;
 
 import com.android.settings.TestConfig;
+import com.android.settings.testutils.FakeFeatureFactory;
 import com.android.settingslib.drawer.CategoryKey;
 import com.android.settingslib.drawer.Tile;
 
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.mockito.Answers;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.annotation.Config;
+import org.robolectric.shadows.ShadowApplication;
+
+import java.util.List;
 
 import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.when;
 
 @RunWith(RobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@@ -36,10 +46,17 @@
     private static final String METADATA_CATEGORY = "com.android.settings.category";
     private static final String METADATA_ACCOUNT_TYPE = "com.android.settings.ia.account";
 
+    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
+    private Context mContext;
     private UserAndAccountDashboardFragment mFragment;
 
     @Before
     public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        FakeFeatureFactory.setupForTest(mContext);
+        final FakeFeatureFactory factory =
+                (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
+        when(factory.dashboardFeatureProvider.isEnabled()).thenReturn(true);
         mFragment = new UserAndAccountDashboardFragment();
     }
 
@@ -68,4 +85,15 @@
 
         assertThat(mFragment.displayTile(tile)).isTrue();
     }
+
+    @Test
+    public void testSearchIndexProvider_shouldIndexResource() {
+        final List<SearchIndexableResource> indexRes =
+                UserAndAccountDashboardFragment.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(
+                        ShadowApplication.getInstance().getApplicationContext(),
+                        true /* enabled */);
+
+        assertThat(indexRes).isNotNull();
+        assertThat(indexRes.get(0).xmlResId).isEqualTo(mFragment.getPreferenceScreenResId());
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/core/lifecycle/LifecycleTest.java b/tests/robotests/src/com/android/settings/core/lifecycle/LifecycleTest.java
index 6aae543..db83bbb 100644
--- a/tests/robotests/src/com/android/settings/core/lifecycle/LifecycleTest.java
+++ b/tests/robotests/src/com/android/settings/core/lifecycle/LifecycleTest.java
@@ -16,6 +16,7 @@
 package com.android.settings.core.lifecycle;
 
 import android.content.Context;
+
 import com.android.settings.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
 import com.android.settings.core.lifecycle.events.OnAttach;
@@ -24,6 +25,7 @@
 import com.android.settings.core.lifecycle.events.OnResume;
 import com.android.settings.core.lifecycle.events.OnStart;
 import com.android.settings.core.lifecycle.events.OnStop;
+
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.robolectric.Robolectric;
@@ -47,6 +49,16 @@
         }
     }
 
+    public static class TestFragment extends ObservableFragment {
+
+        final TestObserver mFragObserver;
+
+        public TestFragment() {
+            mFragObserver = new TestObserver();
+            getLifecycle().addObserver(mFragObserver);
+        }
+    }
+
     public static class TestActivity extends ObservableActivity {
 
         final TestObserver mActObserver;
@@ -119,7 +131,7 @@
     }
 
     @Test
-    public void runThroughFragmentLifecycles_shouldObserveEverything() {
+    public void runThroughDialogFragmentLifecycles_shouldObserveEverything() {
         FragmentController<TestDialogFragment> fragmentController =
                 Robolectric.buildFragment(TestDialogFragment.class);
         TestDialogFragment fragment = fragmentController.get();
@@ -134,4 +146,21 @@
         assertThat(fragment.mFragObserver.mOnStopObserved).isTrue();
         assertThat(fragment.mFragObserver.mOnDestroyObserved).isTrue();
     }
+
+    @Test
+    public void runThroughFragmentLifecycles_shouldObserveEverything() {
+        FragmentController<TestFragment> fragmentController =
+                Robolectric.buildFragment(TestFragment.class);
+        TestFragment fragment = fragmentController.get();
+
+        fragmentController.attach().create().start().resume().pause().stop().destroy();
+
+        assertThat(fragment.mFragObserver.mOnAttachObserved).isTrue();
+        assertThat(fragment.mFragObserver.mOnAttachHasContext).isTrue();
+        assertThat(fragment.mFragObserver.mOnStartObserved).isTrue();
+        assertThat(fragment.mFragObserver.mOnResumeObserved).isTrue();
+        assertThat(fragment.mFragObserver.mOnPauseObserved).isTrue();
+        assertThat(fragment.mFragObserver.mOnStopObserved).isTrue();
+        assertThat(fragment.mFragObserver.mOnDestroyObserved).isTrue();
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/gestures/DoubleTapPowerSettingsTest.java b/tests/robotests/src/com/android/settings/gestures/DoubleTapPowerSettingsTest.java
new file mode 100644
index 0000000..b5fdfea
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/gestures/DoubleTapPowerSettingsTest.java
@@ -0,0 +1,69 @@
+/*
+ * 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.gestures;
+
+import android.content.Context;
+import android.provider.SearchIndexableResource;
+
+import com.android.settings.SettingsRobolectricTestRunner;
+import com.android.settings.TestConfig;
+import com.android.settings.testutils.FakeFeatureFactory;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Answers;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.annotation.Config;
+import org.robolectric.shadows.ShadowApplication;
+
+import java.util.List;
+
+import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.when;
+
+@RunWith(SettingsRobolectricTestRunner.class)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+public class DoubleTapPowerSettingsTest {
+
+    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
+    private Context mContext;
+
+    private DoubleTapPowerSettings mSettings;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        FakeFeatureFactory.setupForTest(mContext);
+        final FakeFeatureFactory factory =
+                (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
+        when(factory.dashboardFeatureProvider.isEnabled()).thenReturn(true);
+        mSettings = new DoubleTapPowerSettings();
+    }
+
+    @Test
+    public void testSearchIndexProvider_shouldIndexResource() {
+        final List<SearchIndexableResource> indexRes =
+                DoubleTapPowerSettings.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(
+                        ShadowApplication.getInstance().getApplicationContext(),
+                        true /* enabled */);
+
+        assertThat(indexRes).isNotNull();
+        assertThat(indexRes.get(0).xmlResId).isEqualTo(mSettings.getPreferenceScreenResId());
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/gestures/DoubleTapScreenSettingsTest.java b/tests/robotests/src/com/android/settings/gestures/DoubleTapScreenSettingsTest.java
new file mode 100644
index 0000000..c0aac43
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/gestures/DoubleTapScreenSettingsTest.java
@@ -0,0 +1,69 @@
+/*
+ * 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.gestures;
+
+import android.content.Context;
+import android.provider.SearchIndexableResource;
+
+import com.android.settings.SettingsRobolectricTestRunner;
+import com.android.settings.TestConfig;
+import com.android.settings.testutils.FakeFeatureFactory;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Answers;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.annotation.Config;
+import org.robolectric.shadows.ShadowApplication;
+
+import java.util.List;
+
+import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.when;
+
+@RunWith(SettingsRobolectricTestRunner.class)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+public class DoubleTapScreenSettingsTest {
+
+    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
+    private Context mContext;
+
+    private DoubleTapScreenSettings mSettings;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        FakeFeatureFactory.setupForTest(mContext);
+        final FakeFeatureFactory factory =
+                (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
+        when(factory.dashboardFeatureProvider.isEnabled()).thenReturn(true);
+        mSettings = new DoubleTapScreenSettings();
+    }
+
+    @Test
+    public void testSearchIndexProvider_shouldIndexResource() {
+        final List<SearchIndexableResource> indexRes =
+                DoubleTapScreenSettings.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(
+                        ShadowApplication.getInstance().getApplicationContext(),
+                        true /* enabled */);
+
+        assertThat(indexRes).isNotNull();
+        assertThat(indexRes.get(0).xmlResId).isEqualTo(mSettings.getPreferenceScreenResId());
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/gestures/DoubleTwistGestureSettingsTest.java b/tests/robotests/src/com/android/settings/gestures/DoubleTwistGestureSettingsTest.java
new file mode 100644
index 0000000..f2a56d7
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/gestures/DoubleTwistGestureSettingsTest.java
@@ -0,0 +1,68 @@
+/*
+ * 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.gestures;
+
+import android.content.Context;
+import android.provider.SearchIndexableResource;
+
+import com.android.settings.SettingsRobolectricTestRunner;
+import com.android.settings.TestConfig;
+import com.android.settings.testutils.FakeFeatureFactory;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Answers;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.annotation.Config;
+import org.robolectric.shadows.ShadowApplication;
+
+import java.util.List;
+
+import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.when;
+
+@RunWith(SettingsRobolectricTestRunner.class)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+public class DoubleTwistGestureSettingsTest {
+    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
+    private Context mContext;
+
+    private DoubleTwistGestureSettings mSettings;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        FakeFeatureFactory.setupForTest(mContext);
+        final FakeFeatureFactory factory =
+                (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
+        when(factory.dashboardFeatureProvider.isEnabled()).thenReturn(true);
+        mSettings = new DoubleTwistGestureSettings();
+    }
+
+    @Test
+    public void testSearchIndexProvider_shouldIndexResource() {
+        final List<SearchIndexableResource> indexRes =
+                DoubleTwistGestureSettings.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(
+                        ShadowApplication.getInstance().getApplicationContext(),
+                        true /* enabled */);
+
+        assertThat(indexRes).isNotNull();
+        assertThat(indexRes.get(0).xmlResId).isEqualTo(mSettings.getPreferenceScreenResId());
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/gestures/PickupGestureSettingsTest.java b/tests/robotests/src/com/android/settings/gestures/PickupGestureSettingsTest.java
new file mode 100644
index 0000000..cf08836
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/gestures/PickupGestureSettingsTest.java
@@ -0,0 +1,70 @@
+/*
+ * 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.gestures;
+
+import android.content.Context;
+import android.provider.SearchIndexableResource;
+
+import com.android.settings.SettingsRobolectricTestRunner;
+import com.android.settings.TestConfig;
+import com.android.settings.testutils.FakeFeatureFactory;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Answers;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.annotation.Config;
+import org.robolectric.shadows.ShadowApplication;
+
+import java.util.List;
+
+import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.when;
+
+@RunWith(SettingsRobolectricTestRunner.class)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+public class PickupGestureSettingsTest {
+
+    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
+    private Context mContext;
+
+    private PickupGestureSettings mSettings;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        FakeFeatureFactory.setupForTest(mContext);
+        final FakeFeatureFactory factory =
+                (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
+        when(factory.dashboardFeatureProvider.isEnabled()).thenReturn(true);
+        mSettings = new PickupGestureSettings();
+    }
+
+    @Test
+    public void testSearchIndexProvider_shouldIndexResource() {
+        final List<SearchIndexableResource> indexRes =
+                PickupGestureSettings.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(
+                        ShadowApplication.getInstance().getApplicationContext(),
+                        true /* enabled */);
+
+        assertThat(indexRes).isNotNull();
+        assertThat(indexRes.get(0).xmlResId).isEqualTo(mSettings.getPreferenceScreenResId());
+    }
+
+}
diff --git a/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationSettingsTest.java b/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationSettingsTest.java
index 19185a0..b9f3bac 100644
--- a/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationSettingsTest.java
@@ -17,11 +17,13 @@
 package com.android.settings.gestures;
 
 import android.content.Context;
+import android.provider.SearchIndexableResource;
 
 import com.android.settings.R;
 import com.android.settings.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
 import com.android.settings.core.PreferenceController;
+import com.android.settings.testutils.FakeFeatureFactory;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -30,10 +32,12 @@
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.annotation.Config;
+import org.robolectric.shadows.ShadowApplication;
 
 import java.util.List;
 
 import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@@ -46,6 +50,10 @@
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
+        FakeFeatureFactory.setupForTest(mContext);
+        final FakeFeatureFactory factory =
+                (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
+        when(factory.dashboardFeatureProvider.isEnabled()).thenReturn(true);
         mFragment = new SwipeToNotificationSettings();
     }
 
@@ -62,4 +70,14 @@
         assertThat(controllers.isEmpty()).isFalse();
     }
 
+    @Test
+    public void testSearchIndexProvider_shouldIndexResource() {
+        final List<SearchIndexableResource> indexRes =
+                SwipeToNotificationSettings.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(
+                        ShadowApplication.getInstance().getApplicationContext(),
+                        true /* enabled */);
+
+        assertThat(indexRes).isNotNull();
+        assertThat(indexRes.get(0).xmlResId).isEqualTo(mFragment.getPreferenceScreenResId());
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/network/NetworkDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/network/NetworkDashboardFragmentTest.java
index 6dd9c75..b30e3ff 100644
--- a/tests/robotests/src/com/android/settings/network/NetworkDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/network/NetworkDashboardFragmentTest.java
@@ -16,8 +16,11 @@
 package com.android.settings.network;
 
 import android.content.Context;
+import android.provider.SearchIndexableResource;
+
 import com.android.settings.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
+import com.android.settings.accounts.UserAndAccountDashboardFragment;
 import com.android.settings.testutils.FakeFeatureFactory;
 import com.android.settingslib.drawer.CategoryKey;
 import org.junit.Before;
@@ -27,8 +30,12 @@
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.annotation.Config;
+import org.robolectric.shadows.ShadowApplication;
+
+import java.util.List;
 
 import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@@ -43,6 +50,9 @@
     public void setUp() {
         MockitoAnnotations.initMocks(this);
         FakeFeatureFactory.setupForTest(mContext);
+        final FakeFeatureFactory factory =
+                (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
+        when(factory.dashboardFeatureProvider.isEnabled()).thenReturn(true);
         mFragment = new NetworkDashboardFragment();
     }
 
@@ -50,4 +60,15 @@
     public void testCategory_isNetwork() {
         assertThat(mFragment.getCategoryKey()).isEqualTo(CategoryKey.CATEGORY_NETWORK);
     }
+
+    @Test
+    public void testSearchIndexProvider_shouldIndexResource() {
+        final List<SearchIndexableResource> indexRes =
+                NetworkDashboardFragment.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(
+                        ShadowApplication.getInstance().getApplicationContext(),
+                        true /* enabled */);
+
+        assertThat(indexRes).isNotNull();
+        assertThat(indexRes.get(0).xmlResId).isEqualTo(mFragment.getPreferenceScreenResId());
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/search/SearchFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/search/SearchFeatureProviderImplTest.java
index 06f4322..67189d0 100644
--- a/tests/robotests/src/com/android/settings/search/SearchFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/search/SearchFeatureProviderImplTest.java
@@ -19,16 +19,16 @@
 
 import android.app.Activity;
 import android.view.Menu;
+
 import com.android.settings.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
-import com.android.settings.overlay.FeatureFactory;
 import com.android.settings.search2.SearchFeatureProviderImpl;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Answers;
 import org.mockito.Mock;
-
 import org.mockito.MockitoAnnotations;
 import org.robolectric.Robolectric;
 import org.robolectric.annotation.Config;
@@ -50,19 +50,18 @@
     public void setUp() {
         MockitoAnnotations.initMocks(this);
         mActivity = Robolectric.buildActivity(Activity.class).create().visible().get();
-        mProvider = (SearchFeatureProviderImpl) FeatureFactory.getFactory(mActivity)
-                .getSearchFeatureProvider(mActivity);
+        mProvider = new SearchFeatureProviderImpl(mActivity);
     }
 
     @Test
     public void testPassNull_NoError() {
-        mProvider.setUpSearchMenu(null,null);
+        mProvider.setUpSearchMenu(null, null);
     }
 
     @Test
     public void testSetUpMenu_HasItemAdded() {
         mProvider.setUpSearchMenu(menu, mActivity);
 
-        verify(menu).add(anyInt(),anyInt(), anyInt(), anyString());
+        verify(menu).add(anyInt(), anyInt(), anyInt(), anyString());
     }
 }