diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index e09b4b1..8a50b01 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2530,8 +2530,6 @@
             </intent-filter>
             <meta-data android:name="com.android.settings.category"
                 android:value="com.android.settings.category.ia.apps"/>
-            <meta-data android:name="com.android.settings.summary"
-                android:resource="@string/summary_empty"/>
             <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                 android:value="com.android.settings.notification.ConfigureNotificationSettings" />
             <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
diff --git a/res/layout/preference_widget_seekbar_settings.xml b/res/layout/preference_widget_seekbar_settings.xml
index 87fea99..c25c598 100644
--- a/res/layout/preference_widget_seekbar_settings.xml
+++ b/res/layout/preference_widget_seekbar_settings.xml
@@ -19,36 +19,36 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:minHeight="?android:attr/listPreferredItemHeight"
+    android:layout_marginTop="6dp"
+    android:layout_marginBottom="6dp"
     android:gravity="center_vertical"
+    android:minHeight="?android:attr/listPreferredItemHeight"
     android:paddingStart="?android:attr/listPreferredItemPaddingStart"
-    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
-    android:paddingBottom="6dp"
-    android:paddingTop="6dp">
+    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
 
     <TextView
         android:id="@android:id/title"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginStart="60dp"
-        android:layout_marginEnd="8dp"
+        android:ellipsize="marquee"
+        android:fadingEdge="horizontal"
+        android:paddingStart="56dp"
+        android:paddingEnd="8dp"
         android:singleLine="true"
         android:textAppearance="@android:style/TextAppearance.Material.Subhead"
-        android:textColor="?android:attr/textColorPrimary"
-        android:ellipsize="marquee"
-        android:fadingEdge="horizontal" />
+        android:textColor="?android:attr/textColorPrimary" />
 
     <TextView
         android:id="@android:id/summary"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginStart="60dp"
-        android:layout_marginEnd="8dp"
-        android:layout_below="@android:id/title"
         android:layout_alignStart="@android:id/title"
+        android:layout_below="@android:id/title"
+        android:maxLines="4"
+        android:paddingStart="56dp"
+        android:paddingEnd="8dp"
         android:textAppearance="?android:attr/textAppearanceListItemSecondary"
-        android:textColor="?android:attr/textColorSecondary"
-        android:maxLines="4" />
+        android:textColor="?android:attr/textColorSecondary" />
 
     <com.android.settings.widget.DefaultIndicatorSeekBar
         android:id="@*android:id/seekbar"
@@ -57,7 +57,7 @@
         android:layout_height="48dp"
         android:layout_alignParentEnd="true"
         android:layout_below="@android:id/summary"
-        android:layout_marginEnd="8dp"
-        android:layout_marginStart="44dp" />
+        android:paddingStart="56dp"
+        android:paddingEnd="8dp" />
 
 </RelativeLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 9c1beaa..311aea3 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -3521,9 +3521,9 @@
     <!-- Applications settings screen, setting check box title. If checked, the system allows installation of applications that are downloaded from random places, such as web sites.  [CHAR LIMIT=30] -->
     <string name="install_applications_title">Allow all app sources</string>
     <!-- Category title listing recently used apps [CHAR_LIMIT=50]-->
-    <string name="recent_app_category_title">Recently used apps</string>
+    <string name="recent_app_category_title">Recently opened</string>
     <!-- Preference title for showing all apps on device [CHAR_LIMIT=50]-->
-    <string name="see_all_apps_title">See all apps</string>
+    <string name="see_all_apps_title">See all <xliff:g>%1$d</xliff:g> installed apps</string>
 
     <!-- Warning that appears below the unknown sources switch in settings -->
     <string name="install_all_warning" product="tablet">
diff --git a/res/xml/app_and_notification.xml b/res/xml/app_and_notification.xml
index 9ddff85..47fc378 100644
--- a/res/xml/app_and_notification.xml
+++ b/res/xml/app_and_notification.xml
@@ -30,7 +30,6 @@
         <Preference
             android:title="@string/applications_settings"
             android:key="all_app_info"
-            android:summary="@string/summary_placeholder"
             android:order="20">
             <intent
                 android:action="android.intent.action.MAIN"
diff --git a/src/com/android/settings/MasterClear.java b/src/com/android/settings/MasterClear.java
index 77c6091..dc4c995 100644
--- a/src/com/android/settings/MasterClear.java
+++ b/src/com/android/settings/MasterClear.java
@@ -23,6 +23,7 @@
 import android.accounts.AuthenticatorDescription;
 import android.app.Activity;
 import android.app.FragmentManager;
+import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.PackageManager;
@@ -34,6 +35,7 @@
 import android.os.SystemProperties;
 import android.os.UserHandle;
 import android.os.UserManager;
+import android.provider.Settings;
 import android.support.annotation.VisibleForTesting;
 import android.telephony.euicc.EuiccManager;
 import android.util.Log;
@@ -208,9 +210,7 @@
             });
         }
 
-        EuiccManager euiccManager =
-                        (EuiccManager) getActivity().getSystemService(Context.EUICC_SERVICE);
-        if (euiccManager.isEnabled()) {
+        if (showWipeEuicc()) {
             mEsimStorageContainer.setOnClickListener(new View.OnClickListener() {
 
                 @Override
@@ -244,6 +244,30 @@
         mScrollView.getViewTreeObserver().addOnGlobalLayoutListener(mOnGlobalLayoutListener);
     }
 
+    /**
+     * Whether to show the checkbox to wipe the eUICC.
+     *
+     * <p>We show the checkbox on any device which supports eUICC as long as either the eUICC was
+     * ever provisioned (that is, at least one profile was ever downloaded onto it), or if the user
+     * has enabled development mode.
+     */
+    @VisibleForTesting
+    boolean showWipeEuicc() {
+        Context context = getContext();
+        if (!isEuiccEnabled(context)) {
+            return false;
+        }
+        ContentResolver cr = context.getContentResolver();
+        return Settings.Global.getInt(cr, Settings.Global.EUICC_PROVISIONED, 0) != 0
+                || Settings.Global.getInt(cr, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0;
+    }
+
+    @VisibleForTesting
+    protected boolean isEuiccEnabled(Context context) {
+        EuiccManager euiccManager = (EuiccManager) context.getSystemService(Context.EUICC_SERVICE);
+        return euiccManager.isEnabled();
+    }
+
     @VisibleForTesting
     boolean hasReachedBottom(final ScrollView scrollView) {
         if (scrollView.getChildCount() < 1) {
diff --git a/src/com/android/settings/applications/RecentAppsPreferenceController.java b/src/com/android/settings/applications/RecentAppsPreferenceController.java
index 43ede2f..7a99508 100644
--- a/src/com/android/settings/applications/RecentAppsPreferenceController.java
+++ b/src/com/android/settings/applications/RecentAppsPreferenceController.java
@@ -77,6 +77,7 @@
 
     private PreferenceCategory mCategory;
     private Preference mSeeAllPref;
+    private boolean mHasRecentApps;
 
     static {
         SKIP_SYSTEM_PACKAGES.addAll(Arrays.asList(
@@ -133,15 +134,20 @@
     @Override
     public void updateState(Preference preference) {
         super.updateState(preference);
+        refreshUi(mCategory.getContext());
         // Show total number of installed apps as See all's summary.
         new InstalledAppCounter(mContext, InstalledAppCounter.IGNORE_INSTALL_REASON,
                 new PackageManagerWrapperImpl(mContext.getPackageManager())) {
             @Override
             protected void onCountComplete(int num) {
-                mSeeAllPref.setSummary(mContext.getString(R.string.apps_summary, num));
+                if (mHasRecentApps) {
+                    mSeeAllPref.setTitle(mContext.getString(R.string.see_all_apps_title, num));
+                } else {
+                    mSeeAllPref.setSummary(mContext.getString(R.string.apps_summary, num));
+                }
             }
         }.execute();
-        refreshUi(mCategory.getContext());
+
     }
 
     @Override
@@ -155,8 +161,10 @@
         reloadData();
         final List<UsageStats> recentApps = getDisplayableRecentAppList();
         if (recentApps != null && !recentApps.isEmpty()) {
+            mHasRecentApps = true;
             displayRecentApps(prefContext, recentApps);
         } else {
+            mHasRecentApps = false;
             displayOnlyAppInfo();
         }
     }
@@ -185,7 +193,7 @@
 
     private void displayRecentApps(Context prefContext, List<UsageStats> recentApps) {
         mCategory.setTitle(R.string.recent_app_category_title);
-        mSeeAllPref.setTitle(R.string.see_all_apps_title);
+        mSeeAllPref.setSummary(null);
         mSeeAllPref.setIcon(R.drawable.ic_chevron_right_24dp);
 
         // Rebind prefs/avoid adding new prefs if possible. Adding/removing prefs causes jank.
diff --git a/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragment.java b/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragment.java
index a08711c..d3617ef 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragment.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragment.java
@@ -23,11 +23,11 @@
 import android.app.Fragment;
 import android.content.Context;
 import android.content.DialogInterface;
-import android.content.DialogInterface.OnClickListener;
 import android.os.Bundle;
 import android.text.TextUtils;
+import android.util.Pair;
 
-import com.android.internal.logging.nano.MetricsProto;
+import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.settings.R;
 import com.android.settings.applications.PackageManagerWrapper;
 import com.android.settings.applications.PackageManagerWrapperImpl;
@@ -63,6 +63,16 @@
     }
 
     @Override
+    protected void onRadioButtonConfirmed(String selectedKey) {
+        mMetricsFeatureProvider.action(getContext(),
+                MetricsEvent.ACTION_SETTINGS_UPDATE_DEFAULT_APP,
+                selectedKey,
+                Pair.create(MetricsEvent.FIELD_CONTEXT, getMetricsCategory()));
+
+        super.onRadioButtonConfirmed(selectedKey);
+    }
+
+    @Override
     public void bindPreferenceExtra(RadioButtonPreference pref,
             String key, CandidateInfo info, String defaultKey, String systemDefaultKey) {
         if (!(info instanceof DefaultAppInfo)) {
@@ -97,7 +107,7 @@
 
         @Override
         public int getMetricsCategory() {
-            return MetricsProto.MetricsEvent.DEFAULT_APP_PICKER_CONFIRMATION_DIALOG;
+            return MetricsEvent.DEFAULT_APP_PICKER_CONFIRMATION_DIALOG;
         }
 
         /**
diff --git a/src/com/android/settings/search/DatabaseResultLoader.java b/src/com/android/settings/search/DatabaseResultLoader.java
index 03f5cb4..26bfd52 100644
--- a/src/com/android/settings/search/DatabaseResultLoader.java
+++ b/src/com/android/settings/search/DatabaseResultLoader.java
@@ -25,10 +25,7 @@
 import com.android.settings.dashboard.SiteMapManager;
 import com.android.settings.utils.AsyncLoader;
 
-import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
 
 import static com.android.settings.search.IndexDatabaseHelper.IndexColumns;
@@ -37,7 +34,7 @@
 /**
  * AsyncTask to retrieve Settings, First party app and any intent based results.
  */
-public class DatabaseResultLoader extends AsyncLoader<List<? extends SearchResult>> {
+public class DatabaseResultLoader extends AsyncLoader<Set<? extends SearchResult>> {
     private static final String LOG = "DatabaseResultLoader";
 
     /* These indices are used to match the columns of the this loader's SELECT statement.
@@ -114,25 +111,22 @@
     }
 
     @Override
-    protected void onDiscardResult(List<? extends SearchResult> result) {
+    protected void onDiscardResult(Set<? extends SearchResult> result) {
         // TODO Search
     }
 
     @Override
-    public List<? extends SearchResult> loadInBackground() {
+    public Set<? extends SearchResult> loadInBackground() {
         if (mQueryText == null || mQueryText.isEmpty()) {
             return null;
         }
 
-        final Set<SearchResult> resultSet = new HashSet<>();
+        final Set<SearchResult> results = new HashSet<>();
 
-        resultSet.addAll(firstWordQuery(MATCH_COLUMNS_PRIMARY, BASE_RANKS[0]));
-        resultSet.addAll(secondaryWordQuery(MATCH_COLUMNS_PRIMARY, BASE_RANKS[1]));
-        resultSet.addAll(anyWordQuery(MATCH_COLUMNS_SECONDARY, BASE_RANKS[2]));
-        resultSet.addAll(anyWordQuery(MATCH_COLUMNS_TERTIARY, BASE_RANKS[3]));
-
-        final List<SearchResult> results = new ArrayList<>(resultSet);
-        Collections.sort(results);
+        results.addAll(firstWordQuery(MATCH_COLUMNS_PRIMARY, BASE_RANKS[0]));
+        results.addAll(secondaryWordQuery(MATCH_COLUMNS_PRIMARY, BASE_RANKS[1]));
+        results.addAll(anyWordQuery(MATCH_COLUMNS_SECONDARY, BASE_RANKS[2]));
+        results.addAll(anyWordQuery(MATCH_COLUMNS_TERTIARY, BASE_RANKS[3]));
         return results;
     }
 
@@ -159,7 +153,7 @@
      *
      * @param matchColumns The columns to match on
      * @param baseRank The highest rank achievable by these results
-     * @return A list of the matching results.
+     * @return A set of the matching results.
      */
     private Set<SearchResult> firstWordQuery(String[] matchColumns, int baseRank) {
         final String whereClause = buildSingleWordWhereClause(matchColumns);
@@ -175,7 +169,7 @@
      *
      * @param matchColumns The columns to match on
      * @param baseRank The highest rank achievable by these results
-     * @return A list of the matching results.
+     * @return A set of the matching results.
      */
     private Set<SearchResult> secondaryWordQuery(String[] matchColumns, int baseRank) {
         final String whereClause = buildSingleWordWhereClause(matchColumns);
@@ -190,7 +184,7 @@
      *
      * @param matchColumns The columns to match on
      * @param baseRank The highest rank achievable by these results
-     * @return A list of the matching results.
+     * @return A set of the matching results.
      */
     private Set<SearchResult> anyWordQuery(String[] matchColumns, int baseRank) {
         final String whereClause = buildTwoWordWhereClause(matchColumns);
@@ -205,7 +199,7 @@
      * @param whereClause Where clause for the SQL query which uses bindings.
      * @param selection List of the transformed query to match each bind in the whereClause
      * @param baseRank The highest rank achievable by these results.
-     * @return A list of the matching results.
+     * @return A set of the matching results.
      */
     private Set<SearchResult> query(String whereClause, String[] selection, int baseRank) {
         SQLiteDatabase database = IndexDatabaseHelper.getInstance(mContext).getReadableDatabase();
diff --git a/src/com/android/settings/search/InlineSwitchViewHolder.java b/src/com/android/settings/search/InlineSwitchViewHolder.java
index 2b3642f..82d33d8 100644
--- a/src/com/android/settings/search/InlineSwitchViewHolder.java
+++ b/src/com/android/settings/search/InlineSwitchViewHolder.java
@@ -41,6 +41,11 @@
     }
 
     @Override
+    public int getClickActionMetricName() {
+        return MetricsEvent.ACTION_CLICK_SETTINGS_SEARCH_INLINE_RESULT;
+    }
+
+    @Override
     public void onBind(SearchFragment fragment, SearchResult result) {
         super.onBind(fragment, result);
         if (mContext == null) {
@@ -49,19 +54,10 @@
         final InlineSwitchPayload payload = (InlineSwitchPayload) result.payload;
         switchView.setChecked(payload.getSwitchValue(mContext));
         switchView.setOnCheckedChangeListener((buttonView, isChecked) -> {
-            final Pair<Integer, Object> name = Pair.create(
-                    MetricsEvent.FIELD_SETTINGS_SEARCH_INLINE_RESULT_NAME, payload.settingsUri);
             final Pair<Integer, Object> value = Pair.create(
                     MetricsEvent.FIELD_SETTINGS_SEARCH_INLINE_RESULT_VALUE, isChecked
-                            ? "checked"
-                            : "not-checked");
-            final Pair<Integer, Object> rank = Pair.create(
-                    MetricsEvent.FIELD_SETTINGS_SERACH_RESULT_RANK, getAdapterPosition());
-            mMetricsFeatureProvider.action(mContext,
-                    MetricsEvent.ACTION_CLICK_SETTINGS_SEARCH_INLINE_RESULT,
-                    name, value, rank);
-
-            fragment.onSearchResultClicked();
+                            ? 1L : 0L);
+            fragment.onSearchResultClicked(this, payload.settingsUri, value);
             payload.setSwitchValue(mContext, isChecked);
         });
     }
diff --git a/src/com/android/settings/search/InstalledAppResultLoader.java b/src/com/android/settings/search/InstalledAppResultLoader.java
index 76f3a00..25a3e89 100644
--- a/src/com/android/settings/search/InstalledAppResultLoader.java
+++ b/src/com/android/settings/search/InstalledAppResultLoader.java
@@ -37,14 +37,14 @@
 import com.android.settings.dashboard.SiteMapManager;
 import com.android.settings.utils.AsyncLoader;
 
-import java.util.ArrayList;
-import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 /**
  * Search loader for installed apps.
  */
-public class InstalledAppResultLoader extends AsyncLoader<List<? extends SearchResult>> {
+public class InstalledAppResultLoader extends AsyncLoader<Set<? extends SearchResult>> {
 
     private static final int NAME_NO_MATCH = -1;
     private static final Intent LAUNCHER_PROBE = new Intent(Intent.ACTION_MAIN)
@@ -67,8 +67,8 @@
     }
 
     @Override
-    public List<? extends SearchResult> loadInBackground() {
-        final List<AppSearchResult> results = new ArrayList<>();
+    public Set<? extends SearchResult> loadInBackground() {
+        final Set<AppSearchResult> results = new HashSet<>();
         final PackageManager pm = mPackageManager.getPackageManager();
 
         for (UserInfo user : getUsersToCount()) {
@@ -103,7 +103,6 @@
                 results.add(builder.build());
             }
         }
-        Collections.sort(results);
         return results;
     }
 
@@ -124,7 +123,7 @@
     }
 
     @Override
-    protected void onDiscardResult(List<? extends SearchResult> result) {
+    protected void onDiscardResult(Set<? extends SearchResult> result) {
 
     }
 
diff --git a/src/com/android/settings/search/IntentSearchViewHolder.java b/src/com/android/settings/search/IntentSearchViewHolder.java
index 68129b6..17ff981 100644
--- a/src/com/android/settings/search/IntentSearchViewHolder.java
+++ b/src/com/android/settings/search/IntentSearchViewHolder.java
@@ -19,7 +19,6 @@
 import android.content.ComponentName;
 import android.content.Intent;
 import android.text.TextUtils;
-import android.util.Pair;
 import android.view.View;
 
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
@@ -36,23 +35,22 @@
     }
 
     @Override
+    public int getClickActionMetricName() {
+        return MetricsEvent.ACTION_CLICK_SETTINGS_SEARCH_RESULT;
+    }
+
+    @Override
     public void onBind(final SearchFragment fragment, final SearchResult result) {
         super.onBind(fragment, result);
 
         itemView.setOnClickListener(v -> {
-            fragment.onSearchResultClicked();
             final Intent intent = result.payload.getIntent();
             final ComponentName cn = intent.getComponent();
-            final Pair<Integer, Object> rank = Pair.create(
-                    MetricsEvent.FIELD_SETTINGS_SERACH_RESULT_RANK, getAdapterPosition());
             String resultName = intent.getStringExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT);
             if (TextUtils.isEmpty(resultName) && cn != null) {
                 resultName = cn.flattenToString();
             }
-            mMetricsFeatureProvider.action(v.getContext(),
-                    MetricsEvent.ACTION_CLICK_SETTINGS_SEARCH_RESULT,
-                    resultName, rank);
-            mSearchFeatureProvider.searchResultClicked(fragment.mQuery, result);
+            fragment.onSearchResultClicked(this, resultName);
             fragment.startActivity(intent);
         });
     }
diff --git a/src/com/android/settings/search/SavedQueryViewHolder.java b/src/com/android/settings/search/SavedQueryViewHolder.java
index 158f698..14509b6 100644
--- a/src/com/android/settings/search/SavedQueryViewHolder.java
+++ b/src/com/android/settings/search/SavedQueryViewHolder.java
@@ -20,6 +20,8 @@
 import android.view.View;
 import android.widget.TextView;
 
+import com.android.internal.logging.nano.MetricsProto;
+
 public class SavedQueryViewHolder extends SearchViewHolder {
 
     public final TextView titleView;
@@ -32,6 +34,11 @@
     }
 
     @Override
+    public int getClickActionMetricName() {
+        return MetricsProto.MetricsEvent.ACTION_CLICK_SETTINGS_SEARCH_SAVED_QUERY;
+    }
+
+    @Override
     public void onBind(SearchFragment fragment, SearchResult result) {
         titleView.setText(result.title);
         titleView.setOnClickListener(v -> fragment.onSavedQueryClicked(result.title));
diff --git a/src/com/android/settings/search/SearchFeatureProvider.java b/src/com/android/settings/search/SearchFeatureProvider.java
index 8e30826..67d4ef1 100644
--- a/src/com/android/settings/search/SearchFeatureProvider.java
+++ b/src/com/android/settings/search/SearchFeatureProvider.java
@@ -19,8 +19,8 @@
 import android.app.Activity;
 import android.content.Context;
 import android.view.Menu;
-
 import android.view.View;
+
 import com.android.settings.dashboard.SiteMapManager;
 
 import java.util.List;
diff --git a/src/com/android/settings/search/SearchFragment.java b/src/com/android/settings/search/SearchFragment.java
index e50558b..1271900 100644
--- a/src/com/android/settings/search/SearchFragment.java
+++ b/src/com/android/settings/search/SearchFragment.java
@@ -28,6 +28,7 @@
 import android.support.v7.widget.RecyclerView;
 import android.text.TextUtils;
 import android.util.Log;
+import android.util.Pair;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -36,14 +37,17 @@
 import android.widget.LinearLayout.LayoutParams;
 import android.widget.SearchView;
 
-import com.android.internal.logging.nano.MetricsProto;
+import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.settings.R;
 import com.android.settings.Utils;
 import com.android.settings.core.InstrumentedFragment;
 import com.android.settings.core.instrumentation.MetricsFeatureProvider;
 import com.android.settings.overlay.FeatureFactory;
 
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
+import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
 
 /**
@@ -57,7 +61,7 @@
  * the query if the user has entered text.
  */
 public class SearchFragment extends InstrumentedFragment implements SearchView.OnQueryTextListener,
-        LoaderManager.LoaderCallbacks<List<? extends SearchResult>>, IndexingCallback {
+        LoaderManager.LoaderCallbacks<Set<? extends SearchResult>>, IndexingCallback {
     private static final String TAG = "SearchFragment";
 
     @VisibleForTesting
@@ -118,7 +122,7 @@
 
     @Override
     public int getMetricsCategory() {
-        return MetricsProto.MetricsEvent.DASHBOARD_SEARCH_RESULTS;
+        return MetricsEvent.DASHBOARD_SEARCH_RESULTS;
     }
 
     @Override
@@ -191,7 +195,7 @@
             mMetricsFeatureProvider.histogram(activity, RESULT_CLICK_COUNT, mResultClickCount);
             if (mNeverEnteredQuery) {
                 mMetricsFeatureProvider.action(activity,
-                        MetricsProto.MetricsEvent.ACTION_LEAVE_SEARCH_RESULT_WITHOUT_QUERY);
+                        MetricsEvent.ACTION_LEAVE_SEARCH_RESULT_WITHOUT_QUERY);
             }
         }
     }
@@ -251,7 +255,7 @@
     }
 
     @Override
-    public Loader<List<? extends SearchResult>> onCreateLoader(int id, Bundle args) {
+    public Loader<Set<? extends SearchResult>> onCreateLoader(int id, Bundle args) {
         final Activity activity = getActivity();
 
         switch (id) {
@@ -265,8 +269,8 @@
     }
 
     @Override
-    public void onLoadFinished(Loader<List<? extends SearchResult>> loader,
-            List<? extends SearchResult> data) {
+    public void onLoadFinished(Loader<Set<? extends SearchResult>> loader,
+            Set<? extends SearchResult> data) {
         mSearchAdapter.addSearchResults(data, loader.getClass().getName());
         if (mUnfinishedLoadersCount.decrementAndGet() != 0) {
             return;
@@ -284,7 +288,7 @@
     }
 
     @Override
-    public void onLoaderReset(Loader<List<? extends SearchResult>> loader) {
+    public void onLoaderReset(Loader<Set<? extends SearchResult>> loader) {
     }
 
     /**
@@ -306,7 +310,26 @@
         requery();
     }
 
-    public void onSearchResultClicked() {
+    public void onSearchResultClicked(SearchViewHolder result, String settingName,
+            Pair<Integer, Object>... logTaggedData) {
+        final List<Pair<Integer, Object>> taggedData = new ArrayList<>();
+        if (logTaggedData != null) {
+            taggedData.addAll(Arrays.asList(logTaggedData));
+        }
+        taggedData.add(Pair.create(
+                MetricsEvent.FIELD_SETTINGS_SERACH_RESULT_COUNT,
+                mSearchAdapter.getItemCount()));
+        taggedData.add(Pair.create(
+                MetricsEvent.FIELD_SETTINGS_SERACH_RESULT_RANK,
+                result.getAdapterPosition()));
+        taggedData.add(Pair.create(
+                MetricsEvent.FIELD_SETTINGS_SERACH_QUERY_LENGTH,
+                TextUtils.isEmpty(mQuery) ? 0 : mQuery.length()));
+
+        mMetricsFeatureProvider.action(getContext(),
+                MetricsEvent.ACTION_CLICK_SETTINGS_SEARCH_RESULT,
+                settingName,
+                taggedData.toArray(new Pair[0]));
         mSavedQueryController.saveQuery(mQuery);
         mResultClickCount++;
     }
@@ -314,7 +337,7 @@
     public void onSavedQueryClicked(CharSequence query) {
         final String queryString = query.toString();
         mMetricsFeatureProvider.action(getContext(),
-                MetricsProto.MetricsEvent.ACTION_CLICK_SETTINGS_SEARCH_SAVED_QUERY);
+                MetricsEvent.ACTION_CLICK_SETTINGS_SEARCH_SAVED_QUERY);
         mSearchView.setQuery(queryString, false /* submit */);
         onQueryTextChange(queryString);
     }
diff --git a/src/com/android/settings/search/SearchResultsAdapter.java b/src/com/android/settings/search/SearchResultsAdapter.java
index 7861b08..31e0793 100644
--- a/src/com/android/settings/search/SearchResultsAdapter.java
+++ b/src/com/android/settings/search/SearchResultsAdapter.java
@@ -30,15 +30,17 @@
 import com.android.settings.R;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 public class SearchResultsAdapter extends RecyclerView.Adapter<SearchViewHolder> {
 
     private final SearchFragment mFragment;
 
     private List<SearchResult> mSearchResults;
-    private Map<String, List<? extends SearchResult>> mResultsMap;
+    private Map<String, Set<? extends SearchResult>> mResultsMap;
     private final SearchFeatureProvider mSearchFeatureProvider;
 
     public SearchResultsAdapter(SearchFragment fragment,
@@ -98,7 +100,7 @@
      * @param loaderClassName class name of the loader.
      */
     @MainThread
-    public void addSearchResults(List<? extends SearchResult> results, String loaderClassName) {
+    public void addSearchResults(Set<? extends SearchResult> results, String loaderClassName) {
         if (results == null) {
             return;
         }
@@ -125,12 +127,22 @@
      * @return Number of matched results
      */
     public int displaySearchResults(String query) {
-        final List<? extends SearchResult> databaseResults = mResultsMap
-                .get(DatabaseResultLoader.class.getName());
-        final List<? extends SearchResult> installedAppResults = mResultsMap
-                .get(InstalledAppResultLoader.class.getName());
-        final int dbSize = (databaseResults != null) ? databaseResults.size() : 0;
-        final int appSize = (installedAppResults != null) ? installedAppResults.size() : 0;
+        List<? extends SearchResult> databaseResults = null;
+        List<? extends SearchResult> installedAppResults = null;
+        final String dbLoaderKey = DatabaseResultLoader.class.getName();
+        final String appLoaderKey = InstalledAppResultLoader.class.getName();
+        int dbSize = 0;
+        int appSize = 0;
+        if (mResultsMap.containsKey(dbLoaderKey)) {
+            databaseResults = new ArrayList<>(mResultsMap.get(dbLoaderKey));
+            dbSize = databaseResults.size();
+            Collections.sort(databaseResults);
+        }
+        if (mResultsMap.containsKey(appLoaderKey)) {
+            installedAppResults = new ArrayList<>(mResultsMap.get(appLoaderKey));
+            appSize = installedAppResults.size();
+            Collections.sort(installedAppResults);
+        }
         final List<SearchResult> newResults = new ArrayList<>(dbSize + appSize);
 
         int dbIndex = 0;
diff --git a/src/com/android/settings/search/SearchViewHolder.java b/src/com/android/settings/search/SearchViewHolder.java
index 93409ee..55fd594 100644
--- a/src/com/android/settings/search/SearchViewHolder.java
+++ b/src/com/android/settings/search/SearchViewHolder.java
@@ -59,6 +59,8 @@
         mPlaceholderSummary = view.getContext().getString(R.string.summary_placeholder);
     }
 
+    public abstract int getClickActionMetricName();
+
     public void onBind(SearchFragment fragment, SearchResult result) {
         titleView.setText(result.title);
         if (TextUtils.isEmpty(result.summary)
diff --git a/tests/robotests/src/com/android/settings/MasterClearTest.java b/tests/robotests/src/com/android/settings/MasterClearTest.java
index 98b33d3..9af2b5f 100644
--- a/tests/robotests/src/com/android/settings/MasterClearTest.java
+++ b/tests/robotests/src/com/android/settings/MasterClearTest.java
@@ -17,13 +17,18 @@
 package com.android.settings;
 
 import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.when;
 import static org.robolectric.Shadows.shadowOf;
 
 import android.app.Activity;
 import android.app.Fragment;
+import android.content.ContentResolver;
 import android.os.Bundle;
+import android.provider.Settings;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.CheckBox;
@@ -83,6 +88,60 @@
     }
 
     @Test
+    public void testShowWipeEuicc_euiccDisabled() {
+        prepareEuiccState(
+                false /* isEuiccEnabled */, true /* isEuiccProvisioned */,
+                true /* isDevelopmentSettingsEnabled */);
+        assertThat(mMasterClear.showWipeEuicc()).isFalse();
+    }
+
+    @Test
+    public void testShowWipeEuicc_euiccEnabled_unprovisioned() {
+        prepareEuiccState(
+                true /* isEuiccEnabled */, false /* isEuiccProvisioned */,
+                false /* isDevelopmentSettingsEnabled */);
+        assertThat(mMasterClear.showWipeEuicc()).isFalse();
+    }
+
+    @Test
+    public void testShowWipeEuicc_euiccEnabled_provisioned() {
+        prepareEuiccState(
+                true /* isEuiccEnabled */, true /* isEuiccProvisioned */,
+                false /* isDevelopmentSettingsEnabled */);
+        assertThat(mMasterClear.showWipeEuicc()).isTrue();
+    }
+
+    @Test
+    public void testShowWipeEuicc_euiccEnabled_developmentSettingsEnabled() {
+        prepareEuiccState(
+                true /* isEuiccEnabled */, false /* isEuiccProvisioned */,
+                true /* isDevelopmentSettingsEnabled */);
+        assertThat(mMasterClear.showWipeEuicc()).isTrue();
+    }
+
+    @Test
+    public void testShowWipeEuicc_euiccEnabled_provisioned_developmentSettingsEnabled() {
+        prepareEuiccState(
+                true /* isEuiccEnabled */, true /* isEuiccProvisioned */,
+                true /* isDevelopmentSettingsEnabled */);
+        assertThat(mMasterClear.showWipeEuicc()).isTrue();
+    }
+
+    private void prepareEuiccState(
+            boolean isEuiccEnabled,
+            boolean isEuiccProvisioned,
+            boolean isDevelopmentSettingsEnabled) {
+        doReturn(mActivity).when(mMasterClear).getContext();
+        doReturn(isEuiccEnabled).when(mMasterClear).isEuiccEnabled(any());
+        ContentResolver cr = mActivity.getContentResolver();
+        Settings.Global.putInt(
+                cr, android.provider.Settings.Global.EUICC_PROVISIONED, isEuiccProvisioned ? 1 : 0);
+        Settings.Global.putInt(
+                cr, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED,
+                isDevelopmentSettingsEnabled ? 1 : 0);
+    }
+
+    @Test
     public void testShowFinalConfirmation_EraseEsimChecked() {
         ActivityForTest testActivity = new ActivityForTest();
         when(mMasterClear.getActivity()).thenReturn(testActivity);
diff --git a/tests/robotests/src/com/android/settings/accounts/AccountPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accounts/AccountPreferenceControllerTest.java
index cf49a35..79ea4da 100644
--- a/tests/robotests/src/com/android/settings/accounts/AccountPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/AccountPreferenceControllerTest.java
@@ -15,25 +15,13 @@
  */
 package com.android.settings.accounts;
 
-import static com.google.common.truth.Truth.assertThat;
-
-import static org.mockito.Answers.RETURNS_DEEP_STUBS;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.argThat;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
 import android.accounts.Account;
 import android.accounts.AccountManager;
 import android.accounts.AuthenticatorDescription;
 import android.content.Context;
 import android.content.pm.UserInfo;
+import android.graphics.drawable.ColorDrawable;
+import android.graphics.drawable.Drawable;
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.support.v7.preference.Preference;
@@ -50,6 +38,7 @@
 import com.android.settings.search.SearchIndexableRaw;
 import com.android.settings.testutils.shadow.ShadowAccountManager;
 import com.android.settings.testutils.shadow.ShadowContentResolver;
+import com.android.settingslib.accounts.AuthenticatorHelper;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -58,11 +47,26 @@
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.annotation.Config;
+import org.robolectric.annotation.Implementation;
+import org.robolectric.annotation.Implements;
 import org.robolectric.shadows.ShadowApplication;
 
 import java.util.ArrayList;
 import java.util.List;
 
+import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Answers.RETURNS_DEEP_STUBS;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.argThat;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
         shadows = {ShadowAccountManager.class, ShadowContentResolver.class})
@@ -212,12 +216,12 @@
         when(mUserManager.getProfiles(anyInt())).thenReturn(infos);
         AccessiblePreferenceCategory preferenceGroup = mock(AccessiblePreferenceCategory.class);
         when(mAccountHelper.createAccessiblePreferenceCategory(any(Context.class))).thenReturn(
-            preferenceGroup);
+                preferenceGroup);
 
         mController.onResume();
 
         verify(preferenceGroup).setTitle(
-            mContext.getString(R.string.account_for_section_header, "user 1"));
+                mContext.getString(R.string.account_for_section_header, "user 1"));
 
     }
 
@@ -310,7 +314,7 @@
         when(mUserManager.getProfiles(anyInt())).thenReturn(infos);
         when(mAccountHelper.hasBaseUserRestriction(
                 eq(UserManager.DISALLOW_REMOVE_MANAGED_PROFILE), anyInt()))
-            .thenReturn(true);
+                .thenReturn(true);
 
         mController.updateRawDataToIndex(data);
 
@@ -325,7 +329,7 @@
         when(mUserManager.isManagedProfile()).thenReturn(false);
         when(mUserManager.getProfiles(anyInt())).thenReturn(infos);
         when(mAccountHelper.hasBaseUserRestriction(
-            eq(UserManager.DISALLOW_MODIFY_ACCOUNTS), anyInt())).thenReturn(true);
+                eq(UserManager.DISALLOW_MODIFY_ACCOUNTS), anyInt())).thenReturn(true);
 
         mController.updateRawDataToIndex(data);
 
@@ -347,18 +351,18 @@
         accountType1[0] = new Account("Account11", "com.acct1");
         accountType1[1] = new Account("Account12", "com.acct1");
         when(mAccountManager.getAccountsByTypeAsUser(eq("com.acct1"), any(UserHandle.class)))
-            .thenReturn(accountType1);
+                .thenReturn(accountType1);
 
         AuthenticatorDescription[] authDescs = {
-            new AuthenticatorDescription("com.acct1", "com.android.settings",
-                R.string.account_settings_title, 0, 0, 0, false)
+                new AuthenticatorDescription("com.acct1", "com.android.settings",
+                        R.string.account_settings_title, 0, 0, 0, false)
         };
         when(mAccountManager.getAuthenticatorTypesAsUser(anyInt())).thenReturn(authDescs);
 
         AccessiblePreferenceCategory preferenceGroup = mock(AccessiblePreferenceCategory.class);
         when(preferenceGroup.getPreferenceManager()).thenReturn(mock(PreferenceManager.class));
         when(mAccountHelper.createAccessiblePreferenceCategory(any(Context.class))).thenReturn(
-            preferenceGroup);
+                preferenceGroup);
 
         mController.onResume();
 
@@ -367,7 +371,8 @@
     }
 
     @Test
-    @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class})
+    @Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class,
+            ShadowAuthenticatorHelper.class})
     public void onResume_twoAccountsOfSameName_shouldAddFivePreferences() {
         final List<UserInfo> infos = new ArrayList<>();
         infos.add(new UserInfo(1, "user 1", 0));
@@ -426,18 +431,18 @@
         accountType1[0] = new Account("Acct11", "com.acct1");
         accountType1[1] = new Account("Acct12", "com.acct1");
         when(mAccountManager.getAccountsByTypeAsUser(eq("com.acct1"), any(UserHandle.class)))
-            .thenReturn(accountType1);
+                .thenReturn(accountType1);
 
         AuthenticatorDescription[] authDescs = {
-            new AuthenticatorDescription("com.acct1", "com.android.settings",
-                R.string.account_settings_title, 0, 0, 0, false)
+                new AuthenticatorDescription("com.acct1", "com.android.settings",
+                        R.string.account_settings_title, 0, 0, 0, false)
         };
         when(mAccountManager.getAuthenticatorTypesAsUser(anyInt())).thenReturn(authDescs);
 
         AccessiblePreferenceCategory preferenceGroup = mock(AccessiblePreferenceCategory.class);
         when(preferenceGroup.getPreferenceManager()).thenReturn(mock(PreferenceManager.class));
         when(mAccountHelper.createAccessiblePreferenceCategory(any(Context.class))).thenReturn(
-            preferenceGroup);
+                preferenceGroup);
         mController.onResume();
 
         mController.onResume();
@@ -461,18 +466,18 @@
         accountType1[0] = new Account("Acct11", "com.acct1");
         accountType1[1] = new Account("Acct12", "com.acct1");
         when(mAccountManager.getAccountsByTypeAsUser(eq("com.acct1"), any(UserHandle.class)))
-            .thenReturn(accountType1);
+                .thenReturn(accountType1);
 
         AuthenticatorDescription[] authDescs = {
-            new AuthenticatorDescription("com.acct1", "com.android.settings",
-                R.string.account_settings_title, 0, 0, 0, false)
+                new AuthenticatorDescription("com.acct1", "com.android.settings",
+                        R.string.account_settings_title, 0, 0, 0, false)
         };
         when(mAccountManager.getAuthenticatorTypesAsUser(anyInt())).thenReturn(authDescs);
 
         AccessiblePreferenceCategory preferenceGroup = mock(AccessiblePreferenceCategory.class);
         when(preferenceGroup.getPreferenceManager()).thenReturn(mock(PreferenceManager.class));
         when(mAccountHelper.createAccessiblePreferenceCategory(any(Context.class))).thenReturn(
-            preferenceGroup);
+                preferenceGroup);
 
         mController.onResume();
 
@@ -482,7 +487,7 @@
         accountType1[1] = new Account("Acct12", "com.acct1");
         accountType1[2] = new Account("Acct13", "com.acct1");
         when(mAccountManager.getAccountsByTypeAsUser(eq("com.acct1"), any(UserHandle.class)))
-            .thenReturn(accountType1);
+                .thenReturn(accountType1);
 
         mController.onResume();
 
@@ -505,7 +510,7 @@
         AccessiblePreferenceCategory preferenceGroup = mock(AccessiblePreferenceCategory.class);
         when(preferenceGroup.getPreferenceManager()).thenReturn(mock(PreferenceManager.class));
         when(mAccountHelper.createAccessiblePreferenceCategory(any(Context.class))).thenReturn(
-            preferenceGroup);
+                preferenceGroup);
 
         // First time resume will build the UI with no account
         mController.onResume();
@@ -514,11 +519,11 @@
         Account[] accounts = {new Account("Acct1", "com.acct1")};
         when(mAccountManager.getAccountsAsUser(2)).thenReturn(accounts);
         when(mAccountManager.getAccountsByTypeAsUser(eq("com.acct1"), any(UserHandle.class)))
-            .thenReturn(accounts);
+                .thenReturn(accounts);
 
         AuthenticatorDescription[] authDescs = {
-            new AuthenticatorDescription("com.acct1", "com.android.settings",
-                R.string.account_settings_title, 0, 0, 0, false)
+                new AuthenticatorDescription("com.acct1", "com.android.settings",
+                        R.string.account_settings_title, 0, 0, 0, false)
         };
         when(mAccountManager.getAuthenticatorTypesAsUser(anyInt())).thenReturn(authDescs);
 
@@ -543,18 +548,18 @@
         accountType1[0] = new Account("Acct11", "com.acct1");
         accountType1[1] = new Account("Acct12", "com.acct1");
         when(mAccountManager.getAccountsByTypeAsUser(eq("com.acct1"), any(UserHandle.class)))
-            .thenReturn(accountType1);
+                .thenReturn(accountType1);
 
         AuthenticatorDescription[] authDescs = {
-            new AuthenticatorDescription("com.acct1", "com.android.settings",
-                R.string.account_settings_title, 0, 0, 0, false)
+                new AuthenticatorDescription("com.acct1", "com.android.settings",
+                        R.string.account_settings_title, 0, 0, 0, false)
         };
         when(mAccountManager.getAuthenticatorTypesAsUser(anyInt())).thenReturn(authDescs);
 
         AccessiblePreferenceCategory preferenceGroup = mock(AccessiblePreferenceCategory.class);
         when(preferenceGroup.getPreferenceManager()).thenReturn(mock(PreferenceManager.class));
         when(mAccountHelper.createAccessiblePreferenceCategory(any(Context.class))).thenReturn(
-            preferenceGroup);
+                preferenceGroup);
 
         mController.onResume();
 
@@ -562,7 +567,7 @@
         accountType1 = new Account[1];
         accountType1[0] = new Account("Acct11", "com.acct1");
         when(mAccountManager.getAccountsByTypeAsUser(eq("com.acct1"), any(UserHandle.class)))
-            .thenReturn(accountType1);
+                .thenReturn(accountType1);
 
         mController.onResume();
 
@@ -574,4 +579,12 @@
     private static ArgumentMatcher<Preference> titleMatches(String expected) {
         return preference -> TextUtils.equals(expected, preference.getTitle());
     }
+
+    @Implements(AuthenticatorHelper.class)
+    public static class ShadowAuthenticatorHelper {
+        @Implementation
+        public Drawable getDrawableForType(Context context, final String accountType) {
+            return new ColorDrawable();
+        }
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java
index c28eed0..4ddea13 100644
--- a/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java
@@ -178,7 +178,7 @@
         // it's invalid app.
         verify(mCategory, times(1)).addPreference(any(Preference.class));
 
-        verify(mSeeAllPref).setTitle(R.string.see_all_apps_title);
+        verify(mSeeAllPref).setSummary(null);
         verify(mSeeAllPref).setIcon(R.drawable.ic_chevron_right_24dp);
     }
 
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragmentTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragmentTest.java
index 2d9ae9b..c138070 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragmentTest.java
@@ -17,18 +17,16 @@
 package com.android.settings.applications.defaultapps;
 
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.when;
-
 import android.app.Activity;
 import android.content.Context;
 import android.os.UserManager;
 import android.support.v7.preference.PreferenceScreen;
+import android.util.Pair;
 
+import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
+import com.android.settings.testutils.FakeFeatureFactory;
 import com.android.settings.widget.RadioButtonPreference;
 
 import org.junit.Before;
@@ -43,6 +41,13 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class DefaultAppPickerFragmentTest {
@@ -54,11 +59,13 @@
     @Mock
     private UserManager mUserManager;
 
+    private FakeFeatureFactory mFeatureFactory;
     private TestFragment mFragment;
 
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
+        mFeatureFactory = FakeFeatureFactory.setupForTest(mActivity);
         mFragment = spy(new TestFragment());
 
         when(mActivity.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
@@ -68,6 +75,7 @@
 
     @Test
     public void clickPreference_hasConfirmation_shouldShowConfirmation() {
+        mFragment.onAttach((Context) mActivity);
         final RadioButtonPreference pref =
                 new RadioButtonPreference(RuntimeEnvironment.application);
         pref.setKey("TEST");
@@ -78,6 +86,17 @@
         mFragment.onRadioButtonClicked(pref);
     }
 
+    @Test
+    public void onRadioButtonConfirmed_shouldLog() {
+        mFragment.onAttach((Context) mActivity);
+        mFragment.onRadioButtonConfirmed("test_pkg");
+
+        verify(mFeatureFactory.metricsFeatureProvider).action(any(Context.class),
+                eq(MetricsProto.MetricsEvent.ACTION_SETTINGS_UPDATE_DEFAULT_APP),
+                eq("test_pkg"),
+                any(Pair.class));
+    }
+
     public static class TestFragment extends DefaultAppPickerFragment {
 
         boolean setDefaultAppKeyCalled;
diff --git a/tests/robotests/src/com/android/settings/search/DatabaseIndexingManagerTest.java b/tests/robotests/src/com/android/settings/search/DatabaseIndexingManagerTest.java
index ab8891b..dda5c28 100644
--- a/tests/robotests/src/com/android/settings/search/DatabaseIndexingManagerTest.java
+++ b/tests/robotests/src/com/android/settings/search/DatabaseIndexingManagerTest.java
@@ -33,19 +33,14 @@
 import android.os.Build;
 import android.provider.SearchIndexableResource;
 import android.util.ArrayMap;
+
 import com.android.settings.R;
 import com.android.settings.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
-import com.android.settings.search.DatabaseIndexingManager;
-import com.android.settings.search.IndexDatabaseHelper;
-import com.android.settings.search.IndexingCallback;
-import com.android.settings.search.ResultPayload;
-import com.android.settings.search.ResultPayloadUtils;
-import com.android.settings.search.SearchFeatureProviderImpl;
-import com.android.settings.search.SearchIndexableRaw;
 import com.android.settings.testutils.DatabaseTestUtils;
 import com.android.settings.testutils.shadow.ShadowDatabaseIndexingUtils;
 import com.android.settings.testutils.shadow.ShadowRunnableAsyncTask;
+
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -140,7 +135,7 @@
 
     @After
     public void cleanUp() {
-        DatabaseTestUtils.clearDb();
+        DatabaseTestUtils.clearDb(mContext);
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/search/DatabaseResultLoaderTest.java b/tests/robotests/src/com/android/settings/search/DatabaseResultLoaderTest.java
index bcd3371..5118cff 100644
--- a/tests/robotests/src/com/android/settings/search/DatabaseResultLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/search/DatabaseResultLoaderTest.java
@@ -25,13 +25,6 @@
 import com.android.settings.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
 import com.android.settings.dashboard.SiteMapManager;
-import com.android.settings.search.DatabaseIndexingUtils;
-import com.android.settings.search.DatabaseResultLoader;
-import com.android.settings.search.IndexDatabaseHelper;
-import com.android.settings.search.InlineSwitchPayload;
-import com.android.settings.search.ResultPayload;
-import com.android.settings.search.ResultPayloadUtils;
-import com.android.settings.search.SearchResult;
 import com.android.settings.testutils.DatabaseTestUtils;
 import com.android.settings.testutils.FakeFeatureFactory;
 
@@ -45,7 +38,10 @@
 import org.robolectric.RuntimeEnvironment;
 import org.robolectric.annotation.Config;
 
+import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import static com.google.common.truth.Truth.assertThat;
 import static org.mockito.Matchers.anyString;
@@ -81,7 +77,7 @@
 
     @After
     public void cleanUp() {
-        DatabaseTestUtils.clearDb();
+        DatabaseTestUtils.clearDb(mContext);
     }
 
     @Test
@@ -224,17 +220,19 @@
     }
 
     @Test
-    public void testSpecialCaseTwoWords_firstWordMatches_ranksHigher() {
+    public void testSpecialCaseTwoWords_multipleResults() {
         final String caseOne = "Apple pear";
         final String caseTwo = "Banana apple";
         insertSpecialCase(caseOne);
         insertSpecialCase(caseTwo);
         DatabaseResultLoader loader = new DatabaseResultLoader(mContext, "App", null);
-        List<? extends SearchResult> results = loader.loadInBackground();
-
-        assertThat(results.get(0).title).isEqualTo(caseOne);
-        assertThat(results.get(1).title).isEqualTo(caseTwo);
-        assertThat(results.get(0).rank).isLessThan(results.get(1).rank);
+        Set<? extends SearchResult> results = loader.loadInBackground();
+        Set<CharSequence> expectedTitles = new HashSet<>(Arrays.asList(caseOne, caseTwo));
+        Set<CharSequence> actualTitles = new HashSet<>();
+        for (SearchResult result : results) {
+            actualTitles.add(result.title);
+        }
+        assertThat(actualTitles).isEqualTo(expectedTitles);
     }
 
     private void insertSpecialCase(String specialCase) {
diff --git a/tests/robotests/src/com/android/settings/search/DynamicIndexableContentMonitorTest.java b/tests/robotests/src/com/android/settings/search/DynamicIndexableContentMonitorTest.java
index 8d585e5..753a512 100644
--- a/tests/robotests/src/com/android/settings/search/DynamicIndexableContentMonitorTest.java
+++ b/tests/robotests/src/com/android/settings/search/DynamicIndexableContentMonitorTest.java
@@ -16,20 +16,6 @@
 
 package com.android.settings.search;
 
-import static com.google.common.truth.Truth.assertThat;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyBoolean;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.only;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
 import android.accessibilityservice.AccessibilityServiceInfo;
 import android.app.Activity;
 import android.app.Application;
@@ -91,6 +77,19 @@
 import java.util.Collections;
 import java.util.List;
 
+import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyBoolean;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.only;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(
         manifest = TestConfig.MANIFEST_PATH,
@@ -163,7 +162,7 @@
         DynamicIndexableContentMonitor.resetForTesting();
         mRobolectricPackageManager.reset();
 
-        DatabaseTestUtils.clearDb();
+        DatabaseTestUtils.clearDb(mActivity);
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/search/InlineSwitchViewHolderTest.java b/tests/robotests/src/com/android/settings/search/InlineSwitchViewHolderTest.java
index 65d99f4..ce483a4 100644
--- a/tests/robotests/src/com/android/settings/search/InlineSwitchViewHolderTest.java
+++ b/tests/robotests/src/com/android/settings/search/InlineSwitchViewHolderTest.java
@@ -19,10 +19,8 @@
 
 import android.content.Context;
 import android.graphics.drawable.Drawable;
-import android.util.Pair;
 import android.view.LayoutInflater;
 
-import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
 import com.android.settings.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
@@ -42,8 +40,6 @@
 
 import static com.google.common.truth.Truth.assertThat;
 import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 @RunWith(SettingsRobolectricTestRunner.class)
@@ -98,10 +94,6 @@
 
         mHolder.switchView.performClick();
 
-        verify(mFeatureFactory.metricsFeatureProvider).action(
-                any(Context.class),
-                eq(MetricsProto.MetricsEvent.ACTION_CLICK_SETTINGS_SEARCH_INLINE_RESULT),
-                any(Pair.class), any(Pair.class), any(Pair.class));
         assertThat(mHolder.titleView.getText()).isEqualTo(TITLE);
         assertThat(mHolder.summaryView.getText()).isEqualTo(SUMMARY);
         assertThat(mHolder.iconView.getDrawable()).isEqualTo(mIcon);
diff --git a/tests/robotests/src/com/android/settings/search/InstalledAppResultLoaderTest.java b/tests/robotests/src/com/android/settings/search/InstalledAppResultLoaderTest.java
index e167091..1a30157 100644
--- a/tests/robotests/src/com/android/settings/search/InstalledAppResultLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/search/InstalledAppResultLoaderTest.java
@@ -43,7 +43,9 @@
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import static android.content.pm.ApplicationInfo.FLAG_SYSTEM;
 import static android.content.pm.ApplicationInfo.FLAG_UPDATED_SYSTEM_APP;
@@ -185,18 +187,19 @@
     }
 
     @Test
-    public void query_matchingQuery_shouldRankBasedOnSimilarity() {
+    public void query_matchingQuery_multipleResults() {
         final String query = "app";
 
         mLoader = new InstalledAppResultLoader(mContext, mPackageManagerWrapper, query,
                 mSiteMapManager);
-        final List<? extends SearchResult> results = mLoader.loadInBackground();
+        final Set<? extends SearchResult> results = mLoader.loadInBackground();
 
-        // List is sorted by rank
-        assertThat(results.get(0).rank).isAtMost(results.get(1).rank);
-        assertThat(results.get(0).title).isEqualTo("app4");
-        assertThat(results.get(1).title).isEqualTo("app");
-        assertThat(results.get(2).title).isEqualTo("appBuffer");
+        Set<CharSequence> expectedTitles = new HashSet<>(Arrays.asList("app4", "app", "appBuffer"));
+        Set<CharSequence> actualTitles = new HashSet<>();
+        for (SearchResult result : results) {
+            actualTitles.add(result.title);
+        }
+        assertThat(actualTitles).isEqualTo(expectedTitles);
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/search/IntentSearchViewHolderTest.java b/tests/robotests/src/com/android/settings/search/IntentSearchViewHolderTest.java
index ee1c913..ba1408f7 100644
--- a/tests/robotests/src/com/android/settings/search/IntentSearchViewHolderTest.java
+++ b/tests/robotests/src/com/android/settings/search/IntentSearchViewHolderTest.java
@@ -21,18 +21,12 @@
 import android.content.Context;
 import android.content.Intent;
 import android.graphics.drawable.Drawable;
-import android.util.Pair;
 import android.view.LayoutInflater;
 import android.view.View;
 
-import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
 import com.android.settings.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
-import com.android.settings.search.IntentSearchViewHolder;
-import com.android.settings.search.ResultPayload;
-import com.android.settings.search.SearchFragment;
-import com.android.settings.search.SearchResult;
 import com.android.settings.search.SearchResult.Builder;
 import com.android.settings.testutils.FakeFeatureFactory;
 
@@ -51,6 +45,7 @@
 
 import static com.google.common.truth.Truth.assertThat;
 import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.verify;
 
@@ -102,12 +97,8 @@
         assertThat(mHolder.summaryView.getVisibility()).isEqualTo(View.VISIBLE);
         assertThat(mHolder.breadcrumbView.getVisibility()).isEqualTo(View.GONE);
 
-        verify(mFragment).onSearchResultClicked();
+        verify(mFragment).onSearchResultClicked(eq(mHolder), anyString());
         verify(mFragment).startActivity(any(Intent.class));
-        verify(mFeatureFactory.metricsFeatureProvider).action(any(Context.class),
-                eq(MetricsProto.MetricsEvent.ACTION_CLICK_SETTINGS_SEARCH_RESULT),
-                eq(((ResultPayload)result.payload).getIntent().getComponent().flattenToString()),
-                any(Pair.class));
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/search/MockAppLoader.java b/tests/robotests/src/com/android/settings/search/MockAppLoader.java
index 35e56a1..c68cbdf 100644
--- a/tests/robotests/src/com/android/settings/search/MockAppLoader.java
+++ b/tests/robotests/src/com/android/settings/search/MockAppLoader.java
@@ -21,8 +21,8 @@
 import com.android.settings.search.InstalledAppResultLoader;
 import com.android.settings.search.SearchResult;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.HashSet;
+import java.util.Set;
 
 /**
  * Mock loader to subvert the requirements of returning data while also driving the Loader
@@ -35,12 +35,12 @@
     }
 
     @Override
-    public List<? extends SearchResult> loadInBackground() {
-        return new ArrayList<>();
+    public Set<? extends SearchResult> loadInBackground() {
+        return new HashSet<>();
     }
 
     @Override
-    protected void onDiscardResult(List<? extends SearchResult> result) {
+    protected void onDiscardResult(Set<? extends SearchResult> result) {
 
     }
 }
diff --git a/tests/robotests/src/com/android/settings/search/MockDBLoader.java b/tests/robotests/src/com/android/settings/search/MockDBLoader.java
index 562e375..b28c1ed 100644
--- a/tests/robotests/src/com/android/settings/search/MockDBLoader.java
+++ b/tests/robotests/src/com/android/settings/search/MockDBLoader.java
@@ -21,8 +21,8 @@
 import com.android.settings.search.DatabaseResultLoader;
 import com.android.settings.search.SearchResult;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.HashSet;
+import java.util.Set;
 
 /**
  * Mock loader to subvert the requirements of returning data while also driving the Loader
@@ -35,12 +35,12 @@
     }
 
     @Override
-    public List<? extends SearchResult> loadInBackground() {
-        return new ArrayList<>();
+    public Set<? extends SearchResult> loadInBackground() {
+        return new HashSet<>();
     }
 
     @Override
-    protected void onDiscardResult(List<? extends SearchResult> result) {
+    protected void onDiscardResult(Set<? extends SearchResult> result) {
 
     }
 }
diff --git a/tests/robotests/src/com/android/settings/search/SavedQueryLoaderTest.java b/tests/robotests/src/com/android/settings/search/SavedQueryLoaderTest.java
index 5222360..943fa7e 100644
--- a/tests/robotests/src/com/android/settings/search/SavedQueryLoaderTest.java
+++ b/tests/robotests/src/com/android/settings/search/SavedQueryLoaderTest.java
@@ -59,7 +59,7 @@
 
     @After
     public void cleanUp() {
-        DatabaseTestUtils.clearDb();
+        DatabaseTestUtils.clearDb(mContext);
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/search/SavedQueryRecorderAndRemoverTest.java b/tests/robotests/src/com/android/settings/search/SavedQueryRecorderAndRemoverTest.java
index 5037626..e60d21a 100644
--- a/tests/robotests/src/com/android/settings/search/SavedQueryRecorderAndRemoverTest.java
+++ b/tests/robotests/src/com/android/settings/search/SavedQueryRecorderAndRemoverTest.java
@@ -22,10 +22,6 @@
 
 import com.android.settings.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
-import com.android.settings.search.SavedQueryLoader;
-import com.android.settings.search.SavedQueryRecorder;
-import com.android.settings.search.SavedQueryRemover;
-import com.android.settings.search.SearchResult;
 import com.android.settings.testutils.DatabaseTestUtils;
 
 import org.junit.After;
@@ -54,7 +50,7 @@
 
     @After
     public void cleanUp() {
-        DatabaseTestUtils.clearDb();
+        DatabaseTestUtils.clearDb(mContext);
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/search/SearchFragmentTest.java b/tests/robotests/src/com/android/settings/search/SearchFragmentTest.java
index 94dc233..44851b1 100644
--- a/tests/robotests/src/com/android/settings/search/SearchFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/search/SearchFragmentTest.java
@@ -21,18 +21,22 @@
 import android.content.Context;
 import android.content.Loader;
 import android.os.Bundle;
+import android.util.Pair;
 import android.view.View;
 
 import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
 import com.android.settings.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
+import com.android.settings.testutils.DatabaseTestUtils;
 import com.android.settings.testutils.FakeFeatureFactory;
 
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Answers;
+import org.mockito.ArgumentMatcher;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.Robolectric;
@@ -41,11 +45,13 @@
 import org.robolectric.util.ActivityController;
 import org.robolectric.util.ReflectionHelpers;
 
-import java.util.List;
+import java.util.Set;
 
 import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.ArgumentMatchers.nullable;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyString;
+import static org.mockito.Matchers.argThat;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
@@ -79,6 +85,11 @@
         mFeatureFactory = (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
     }
 
+    @After
+    public void tearDown() {
+        DatabaseTestUtils.clearDb(RuntimeEnvironment.application);
+    }
+
     @Test
     public void screenRotate_shouldPersistQuery() {
         when(mFeatureFactory.searchFeatureProvider
@@ -249,7 +260,7 @@
 
         Robolectric.flushForegroundThreadScheduler();
 
-        verify(fragment, times(2)).onLoadFinished(any(Loader.class), any(List.class));
+        verify(fragment, times(2)).onLoadFinished(any(Loader.class), any(Set.class));
     }
 
     @Test
@@ -353,12 +364,12 @@
     @Test
     public void onIndexingFinished_noActivity_shouldNotCrash() {
         ActivityController<SearchActivity> activityController =
-            Robolectric.buildActivity(SearchActivity.class);
+                Robolectric.buildActivity(SearchActivity.class);
         activityController.setup();
         SearchFragment fragment = (SearchFragment) spy(activityController.get().getFragmentManager()
-            .findFragmentById(R.id.main_content));
+                .findFragmentById(R.id.main_content));
         when(mFeatureFactory.searchFeatureProvider.isIndexingComplete(any(Context.class)))
-            .thenReturn(true);
+                .thenReturn(true);
         fragment.mQuery = "bright";
         ReflectionHelpers.setField(fragment, "mLoaderManager", null);
         ReflectionHelpers.setField(fragment, "mHost", null);
@@ -366,4 +377,29 @@
         fragment.onIndexingFinished();
         // no crash
     }
+
+    @Test
+    public void onSearchResultClicked_shouldLogResultMeta() {
+        SearchFragment fragment = new SearchFragment();
+        ReflectionHelpers.setField(fragment, "mMetricsFeatureProvider",
+                mFeatureFactory.metricsFeatureProvider);
+        ReflectionHelpers.setField(fragment, "mSearchAdapter", mock(SearchResultsAdapter.class));
+        fragment.mSavedQueryController = mock(SavedQueryController.class);
+
+        // Should log result name, result count, clicked rank, etc.
+        final SearchViewHolder result = mock(SearchViewHolder.class);
+        fragment.onSearchResultClicked(result, "test_setting");
+
+        verify(mFeatureFactory.metricsFeatureProvider).action(
+                nullable(Context.class),
+                eq(MetricsProto.MetricsEvent.ACTION_CLICK_SETTINGS_SEARCH_RESULT),
+                eq("test_setting"),
+                argThat(pairMatches(MetricsProto.MetricsEvent.FIELD_SETTINGS_SERACH_RESULT_COUNT)),
+                argThat(pairMatches(MetricsProto.MetricsEvent.FIELD_SETTINGS_SERACH_RESULT_RANK)),
+                argThat(pairMatches(MetricsProto.MetricsEvent.FIELD_SETTINGS_SERACH_QUERY_LENGTH)));
+    }
+
+    private ArgumentMatcher<Pair<Integer, Object>> pairMatches(int tag) {
+        return pair -> pair.first == tag;
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/search/SearchResultsAdapterTest.java b/tests/robotests/src/com/android/settings/search/SearchResultsAdapterTest.java
index 5af8550..8290348 100644
--- a/tests/robotests/src/com/android/settings/search/SearchResultsAdapterTest.java
+++ b/tests/robotests/src/com/android/settings/search/SearchResultsAdapterTest.java
@@ -46,8 +46,10 @@
 import static org.mockito.Mockito.when;
 
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Objects;
+import java.util.Set;
 
 import static com.google.common.truth.Truth.assertThat;
 
@@ -85,7 +87,7 @@
 
     @Test
     public void testSingleSourceMerge_exactCopyReturned() {
-        ArrayList<SearchResult> intentResults = getIntentSampleResults();
+        Set<SearchResult> intentResults = getIntentSampleResults();
         mAdapter.addSearchResults(intentResults, mLoaderClassName);
         mAdapter.displaySearchResults("");
 
@@ -111,8 +113,10 @@
 
     @Test
     public void testEndToEndSearch_properResultsMerged_correctOrder() {
-        mAdapter.addSearchResults(getDummyAppResults(), InstalledAppResultLoader.class.getName());
-        mAdapter.addSearchResults(getDummyDbResults(), DatabaseResultLoader.class.getName());
+        mAdapter.addSearchResults(new HashSet<SearchResult>(getDummyAppResults()),
+                InstalledAppResultLoader.class.getName());
+        mAdapter.addSearchResults(new HashSet<SearchResult>(getDummyDbResults()),
+                DatabaseResultLoader.class.getName());
         int count = mAdapter.displaySearchResults("");
 
         List<SearchResult> results = mAdapter.getSearchResults();
@@ -130,13 +134,16 @@
         List<AppSearchResult> appResults = getDummyAppResults();
         List<SearchResult> dbResults = getDummyDbResults();
         // Add two individual items
-        mAdapter.addSearchResults(appResults.subList(0,1),
+        mAdapter.addSearchResults(new HashSet<SearchResult>(appResults.subList(0, 1)),
                 InstalledAppResultLoader.class.getName());
-        mAdapter.addSearchResults(dbResults.subList(0,1), DatabaseResultLoader.class.getName());
+        mAdapter.addSearchResults(new HashSet<SearchResult>(dbResults.subList(0, 1)),
+                DatabaseResultLoader.class.getName());
         mAdapter.displaySearchResults("");
         // Add super-set of items
-        mAdapter.addSearchResults(appResults, InstalledAppResultLoader.class.getName());
-        mAdapter.addSearchResults(dbResults, DatabaseResultLoader.class.getName());
+        mAdapter.addSearchResults(
+                new HashSet<SearchResult>(appResults), InstalledAppResultLoader.class.getName());
+        mAdapter.addSearchResults(
+                new HashSet<SearchResult>(dbResults), DatabaseResultLoader.class.getName());
         int count = mAdapter.displaySearchResults("");
 
         List<SearchResult> results = mAdapter.getSearchResults();
@@ -170,13 +177,16 @@
         List<AppSearchResult> appResults = getDummyAppResults();
         List<SearchResult> dbResults = getDummyDbResults();
         // Add list of items
-        mAdapter.addSearchResults(appResults, InstalledAppResultLoader.class.getName());
-        mAdapter.addSearchResults(dbResults, DatabaseResultLoader.class.getName());
+        mAdapter.addSearchResults(new HashSet<SearchResult>(appResults),
+                InstalledAppResultLoader.class.getName());
+        mAdapter.addSearchResults(new HashSet<SearchResult>(dbResults),
+                DatabaseResultLoader.class.getName());
         mAdapter.displaySearchResults("");
         // Add subset of items
-        mAdapter.addSearchResults(appResults.subList(0,1),
+        mAdapter.addSearchResults(new HashSet<SearchResult>(appResults.subList(0, 1)),
                 InstalledAppResultLoader.class.getName());
-        mAdapter.addSearchResults(dbResults.subList(0,1), DatabaseResultLoader.class.getName());
+        mAdapter.addSearchResults(new HashSet<>(dbResults.subList(0, 1)),
+                DatabaseResultLoader.class.getName());
         int count = mAdapter.displaySearchResults("");
 
         List<SearchResult> results = mAdapter.getSearchResults();
@@ -231,8 +241,8 @@
         return results;
     }
 
-    private ArrayList<SearchResult> getIntentSampleResults() {
-        ArrayList<SearchResult> sampleResults = new ArrayList<>();
+    private Set<SearchResult> getIntentSampleResults() {
+        Set<SearchResult> sampleResults = new HashSet<>();
         ArrayList<String> breadcrumbs = new ArrayList<>();
         final Drawable icon = mContext.getDrawable(R.drawable.ic_search_history);
         final ResultPayload payload = new ResultPayload(null);
diff --git a/tests/robotests/src/com/android/settings/search/SiteMapManagerTest.java b/tests/robotests/src/com/android/settings/search/SiteMapManagerTest.java
index 2e585ac..b0a5b00 100644
--- a/tests/robotests/src/com/android/settings/search/SiteMapManagerTest.java
+++ b/tests/robotests/src/com/android/settings/search/SiteMapManagerTest.java
@@ -80,7 +80,7 @@
 
     @After
     public void cleanUp() {
-        DatabaseTestUtils.clearDb();
+        DatabaseTestUtils.clearDb(mContext);
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/testutils/DatabaseTestUtils.java b/tests/robotests/src/com/android/settings/testutils/DatabaseTestUtils.java
index 8fbe1c9..7472996 100644
--- a/tests/robotests/src/com/android/settings/testutils/DatabaseTestUtils.java
+++ b/tests/robotests/src/com/android/settings/testutils/DatabaseTestUtils.java
@@ -16,13 +16,18 @@
 
 package com.android.settings.testutils;
 
+import android.content.Context;
+
 import com.android.settings.search.IndexDatabaseHelper;
 
 import java.lang.reflect.Field;
 
 public class DatabaseTestUtils {
 
-    public static void clearDb() {
+    public static void clearDb(Context context) {
+        IndexDatabaseHelper helper = IndexDatabaseHelper.getInstance(context);
+        helper.close();
+
         Field instance;
         Class clazz = IndexDatabaseHelper.class;
         try {
diff --git a/tests/robotests/src/com/android/settings/webview/WebViewAppPickerTest.java b/tests/robotests/src/com/android/settings/webview/WebViewAppPickerTest.java
index 655f354..56397f0 100644
--- a/tests/robotests/src/com/android/settings/webview/WebViewAppPickerTest.java
+++ b/tests/robotests/src/com/android/settings/webview/WebViewAppPickerTest.java
@@ -16,20 +16,6 @@
 
 package com.android.settings.webview;
 
-import static android.provider.Settings.ACTION_WEBVIEW_SETTINGS;
-import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
 import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
@@ -44,6 +30,8 @@
 import com.android.settings.TestConfig;
 import com.android.settings.applications.PackageManagerWrapper;
 import com.android.settings.applications.defaultapps.DefaultAppInfo;
+import com.android.settings.core.instrumentation.MetricsFeatureProvider;
+import com.android.settings.testutils.FakeFeatureFactory;
 import com.android.settings.widget.RadioButtonPreference;
 
 import org.junit.Before;
@@ -58,6 +46,20 @@
 
 import java.util.Arrays;
 
+import static android.provider.Settings.ACTION_WEBVIEW_SETTINGS;
+import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class WebViewAppPickerTest {
@@ -87,6 +89,7 @@
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
+        FakeFeatureFactory.setupForTest(mActivity);
         when(mActivity.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
 
         mPicker = new WebViewAppPicker();
@@ -96,7 +99,8 @@
         doReturn(mActivity).when(mPicker).getActivity();
 
         ReflectionHelpers.setField(mPicker, "mPm", mPackageManager);
-
+        ReflectionHelpers.setField(mPicker, "mMetricsFeatureProvider",
+                mock(MetricsFeatureProvider.class));
         mWvusWrapper = mock(WebViewUpdateServiceWrapper.class);
         mPicker.setWebViewUpdateServiceWrapper(mWvusWrapper);
     }
diff --git a/tests/robotests/src/com/android/settings/widget/RadioButtonPickerFragmentTest.java b/tests/robotests/src/com/android/settings/widget/RadioButtonPickerFragmentTest.java
index e6d00b3..b0889b4 100644
--- a/tests/robotests/src/com/android/settings/widget/RadioButtonPickerFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/widget/RadioButtonPickerFragmentTest.java
@@ -16,12 +16,6 @@
 
 package com.android.settings.widget;
 
-import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
 import android.app.Activity;
 import android.content.Context;
 import android.os.UserManager;
@@ -30,7 +24,7 @@
 import com.android.settings.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
 import com.android.settings.applications.defaultapps.DefaultAppInfo;
-import com.android.settings.applications.defaultapps.DefaultAppPickerFragment;
+import com.android.settings.testutils.FakeFeatureFactory;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -44,6 +38,12 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
 public class RadioButtonPickerFragmentTest {
@@ -61,6 +61,7 @@
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
+        FakeFeatureFactory.setupForTest(mActivity);
         mFragment = spy(new TestFragment());
 
         when(mActivity.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
@@ -72,7 +73,6 @@
     public void onAttach_userIsInitialized() {
         mFragment.onAttach((Context) mActivity);
 
-        verify(mActivity).getPackageManager();
         verify(mActivity).getSystemService(Context.USER_SERVICE);
     }
 
@@ -99,7 +99,7 @@
         assertThat(mFragment.setDefaultKeyCalled).isTrue();
     }
 
-    public static class TestFragment extends DefaultAppPickerFragment {
+    public static class TestFragment extends RadioButtonPickerFragment {
 
         boolean setDefaultKeyCalled;
 
