diff --git a/java/com/android/dialer/common/FragmentUtils.java b/java/com/android/dialer/common/FragmentUtils.java
index c07d9a7..aa4441e 100644
--- a/java/com/android/dialer/common/FragmentUtils.java
+++ b/java/com/android/dialer/common/FragmentUtils.java
@@ -59,6 +59,11 @@
       @SuppressWarnings("unchecked") // Casts are checked using runtime methods
       T parent = ((FragmentUtilListener) fragment.getActivity()).getImpl(callbackInterface);
       return parent;
+    } else if (fragment.getActivity() instanceof MainActivityPeer.PeerSupplier) {
+      MainActivityPeer peer = ((MainActivityPeer.PeerSupplier) fragment.getActivity()).getPeer();
+      if (peer instanceof FragmentUtilListener) {
+        return ((FragmentUtilListener) peer).getImpl(callbackInterface);
+      }
     }
     return null;
   }
diff --git a/java/com/android/dialer/main/impl/NewMainActivityPeer.java b/java/com/android/dialer/main/impl/NewMainActivityPeer.java
index 0ab69a4..f2d6fa6 100644
--- a/java/com/android/dialer/main/impl/NewMainActivityPeer.java
+++ b/java/com/android/dialer/main/impl/NewMainActivityPeer.java
@@ -29,7 +29,6 @@
 import com.android.dialer.main.impl.bottomnav.BottomNavBar;
 import com.android.dialer.main.impl.bottomnav.BottomNavBar.OnBottomNavTabSelectedListener;
 import com.android.dialer.main.impl.bottomnav.BottomNavBar.TabIndex;
-import com.android.dialer.speeddial.SpeedDialFragment;
 import com.android.dialer.voicemail.listui.NewVoicemailFragment;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -106,16 +105,18 @@
     @Override
     public void onSpeedDialSelected() {
       hideAllFragments();
-      SpeedDialFragment fragment =
-          (SpeedDialFragment) supportFragmentManager.findFragmentByTag(SPEED_DIAL_TAG);
-      if (fragment == null) {
-        supportFragmentManager
-            .beginTransaction()
-            .add(R.id.fragment_container, SpeedDialFragment.newInstance(), SPEED_DIAL_TAG)
-            .commit();
-      } else {
-        supportFragmentManager.beginTransaction().show(fragment).commit();
-      }
+      // TODO(calderwoodra): Since we aren't using fragment utils in this peer, let's disable
+      // speed dial until we figure out a solution.
+      // SpeedDialFragment fragment =
+      //     (SpeedDialFragment) supportFragmentManager.findFragmentByTag(SPEED_DIAL_TAG);
+      // if (fragment == null) {
+      //   supportFragmentManager
+      //       .beginTransaction()
+      //       .add(R.id.fragment_container, SpeedDialFragment.newInstance(), SPEED_DIAL_TAG)
+      //       .commit();
+      // } else {
+      //   supportFragmentManager.beginTransaction().show(fragment).commit();
+      // }
     }
 
     @Override
diff --git a/java/com/android/dialer/main/impl/OldMainActivityPeer.java b/java/com/android/dialer/main/impl/OldMainActivityPeer.java
index 1c0cad0..9ac3510 100644
--- a/java/com/android/dialer/main/impl/OldMainActivityPeer.java
+++ b/java/com/android/dialer/main/impl/OldMainActivityPeer.java
@@ -183,6 +183,7 @@
   // Speed Dial
   private MainOnPhoneNumberPickerActionListener onPhoneNumberPickerActionListener;
   private MainOldSpeedDialFragmentHost oldSpeedDialFragmentHost;
+  private MainSpeedDialFragmentHost speedDialFragmentHost;
 
   /** Language the device was in last time {@link #onSaveInstanceState(Bundle)} was called. */
   private String savedLanguageCode;
@@ -293,6 +294,7 @@
             activity.findViewById(R.id.remove_view),
             activity.findViewById(R.id.search_view_container),
             toolbar);
+    speedDialFragmentHost = new MainSpeedDialFragmentHost(toolbar);
 
     lastTabController = new LastTabController(activity, bottomNav, showVoicemailTab);
 
@@ -639,6 +641,8 @@
       return (T) oldSpeedDialFragmentHost;
     } else if (callbackInterface.isInstance(searchController)) {
       return (T) searchController;
+    } else if (callbackInterface.isInstance(speedDialFragmentHost)) {
+      return (T) speedDialFragmentHost;
     } else {
       return null;
     }
@@ -1191,6 +1195,25 @@
   }
 
   /**
+   * Handles the callbacks for {@link SpeedDialFragment}.
+   *
+   * @see SpeedDialFragment.HostInterface
+   */
+  private static final class MainSpeedDialFragmentHost implements SpeedDialFragment.HostInterface {
+
+    private final MainToolbar toolbar;
+
+    MainSpeedDialFragmentHost(MainToolbar toolbar) {
+      this.toolbar = toolbar;
+    }
+
+    @Override
+    public void setHasFrequents(boolean hasFrequents) {
+      toolbar.showClearFrequents(hasFrequents);
+    }
+  }
+
+  /**
    * Implementation of {@link OnBottomNavTabSelectedListener} that handles logic for showing each of
    * the main tabs and FAB.
    *
diff --git a/java/com/android/dialer/speeddial/SpeedDialAdapter.java b/java/com/android/dialer/speeddial/SpeedDialAdapter.java
index 6f6ac54..8a37e97 100644
--- a/java/com/android/dialer/speeddial/SpeedDialAdapter.java
+++ b/java/com/android/dialer/speeddial/SpeedDialAdapter.java
@@ -210,4 +210,9 @@
   public void setItemTouchHelper(ItemTouchHelper itemTouchHelper) {
     this.itemTouchHelper = itemTouchHelper;
   }
+
+  /** Returns true if there are suggested contacts. */
+  public boolean hasFrequents() {
+    return !speedDialUiItems.isEmpty() && getItemViewType(getItemCount() - 1) == RowType.SUGGESTION;
+  }
 }
diff --git a/java/com/android/dialer/speeddial/SpeedDialFragment.java b/java/com/android/dialer/speeddial/SpeedDialFragment.java
index 26893a8..b74c062 100644
--- a/java/com/android/dialer/speeddial/SpeedDialFragment.java
+++ b/java/com/android/dialer/speeddial/SpeedDialFragment.java
@@ -34,6 +34,7 @@
 import android.widget.FrameLayout;
 import com.android.dialer.callintent.CallInitiationType;
 import com.android.dialer.callintent.CallIntentBuilder;
+import com.android.dialer.common.FragmentUtils;
 import com.android.dialer.common.LogUtil;
 import com.android.dialer.common.concurrent.DialerExecutorComponent;
 import com.android.dialer.common.concurrent.SupportUiListener;
@@ -132,11 +133,6 @@
     return rootLayout;
   }
 
-  public boolean hasFrequents() {
-    // TODO(calderwoodra)
-    return false;
-  }
-
   @Override
   public void onResume() {
     super.onResume();
@@ -173,12 +169,17 @@
   }
 
   private void onSpeedDialUiItemListLoaded(ImmutableList<SpeedDialUiItem> speedDialUiItems) {
+    LogUtil.enterBlock("SpeedDialFragment.onSpeedDialUiItemListLoaded");
     // TODO(calderwoodra): Use DiffUtil to properly update and animate the change
     adapter.setSpeedDialUiItems(
         UiItemLoaderComponent.get(getContext())
             .speedDialUiItemLoader()
             .insertDuoChannels(getContext(), speedDialUiItems));
     adapter.notifyDataSetChanged();
+    if (getActivity() != null) {
+      FragmentUtils.getParentUnsafe(this, HostInterface.class)
+          .setHasFrequents(adapter.hasFrequents());
+    }
   }
 
   @Override
@@ -359,4 +360,10 @@
                   Contacts.CONTENT_URI, String.valueOf(speedDialUiItem.contactId()))));
     }
   }
+
+  /** Interface for {@link SpeedDialFragment} to communicate with its host/parent. */
+  public interface HostInterface {
+
+    void setHasFrequents(boolean hasFrequents);
+  }
 }
