Remove clear history button am: 56b4759cdb am: be003f6466

Change-Id: I6d97af6a190ba7b43a1696317e5690a84185303a
diff --git a/src/com/android/settings/intelligence/search/car/CarSearchFragment.java b/src/com/android/settings/intelligence/search/car/CarSearchFragment.java
index 544bab9..6a580ab 100644
--- a/src/com/android/settings/intelligence/search/car/CarSearchFragment.java
+++ b/src/com/android/settings/intelligence/search/car/CarSearchFragment.java
@@ -32,10 +32,10 @@
 import androidx.recyclerview.widget.RecyclerView;
 
 import com.android.car.ui.preference.PreferenceFragment;
-import com.android.car.ui.toolbar.ToolbarController;
-import com.android.settings.intelligence.R;
 import com.android.car.ui.toolbar.MenuItem;
 import com.android.car.ui.toolbar.Toolbar;
+import com.android.car.ui.toolbar.ToolbarController;
+import com.android.settings.intelligence.R;
 import com.android.settings.intelligence.overlay.FeatureFactory;
 import com.android.settings.intelligence.search.SearchCommon;
 import com.android.settings.intelligence.search.SearchFeatureProvider;
@@ -44,7 +44,6 @@
 import com.android.settings.intelligence.search.savedqueries.car.CarSavedQueryController;
 import com.android.settings.intelligence.search.savedqueries.car.CarSavedQueryViewHolder;
 
-import java.util.Collections;
 import java.util.List;
 
 /**
@@ -56,7 +55,6 @@
     private SearchFeatureProvider mSearchFeatureProvider;
 
     private ToolbarController mToolbar;
-    private MenuItem mClearHistoryButton;
     private RecyclerView mRecyclerView;
 
     private String mQuery;
@@ -85,7 +83,7 @@
     }
 
     protected List<MenuItem> getToolbarMenuItems() {
-        return Collections.singletonList(mClearHistoryButton);
+        return null;
     }
 
     @Override
@@ -98,12 +96,6 @@
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
-        mClearHistoryButton = new MenuItem.Builder(getContext())
-                .setTitle(R.string.search_clear_history)
-                .setDisplayBehavior(MenuItem.DisplayBehavior.NEVER)
-                .setOnClickListener(i -> onClearHistoryButtonClicked())
-                .build();
-
         if (savedInstanceState != null) {
             mQuery = savedInstanceState.getString(SearchCommon.STATE_QUERY);
             mShowingSavedQuery = savedInstanceState.getBoolean(
@@ -190,10 +182,6 @@
         }
     }
 
-    private void onClearHistoryButtonClicked() {
-        mSavedQueryController.removeQueries();
-    }
-
     /**
      * Gets called when a saved query is clicked.
      */