diff --git a/src/com/android/settings/dashboard/suggestions/SuggestionFeatureProviderImpl.java b/src/com/android/settings/dashboard/suggestions/SuggestionFeatureProviderImpl.java
index e4f58d7..f8b5a8b 100644
--- a/src/com/android/settings/dashboard/suggestions/SuggestionFeatureProviderImpl.java
+++ b/src/com/android/settings/dashboard/suggestions/SuggestionFeatureProviderImpl.java
@@ -25,7 +25,6 @@
 import android.provider.Settings.Secure;
 import android.support.annotation.NonNull;
 import android.support.annotation.VisibleForTesting;
-import android.text.format.DateUtils;
 import android.util.Log;
 
 import com.android.internal.logging.nano.MetricsProto;
@@ -55,12 +54,6 @@
 
     private static final String SHARED_PREF_FILENAME = "suggestions";
 
-    // Suggestion category name and expiration threshold for first impression type. Needs to keep
-    // in sync with suggestion_ordering.xml
-    private static final String CATEGORY_FIRST_IMPRESSION =
-            "com.android.settings.suggested.category.FIRST_IMPRESSION";
-    private static final long FIRST_IMPRESSION_EXPIRE_DAY_IN_MILLIS = 14 * DateUtils.DAY_IN_MILLIS;
-
     private final SuggestionRanker mSuggestionRanker;
     private final MetricsFeatureProvider mMetricsFeatureProvider;
 
@@ -141,12 +134,7 @@
                 context, MetricsProto.MetricsEvent.ACTION_SETTINGS_DISMISS_SUGGESTION,
                 getSuggestionIdentifier(context, suggestion));
 
-        boolean isSmartSuggestionEnabled = isSmartSuggestionEnabled(context);
-        if (isSmartSuggestionEnabled) {
-            // Disable smart suggestion if we are still showing first impression suggestions.
-            isSmartSuggestionEnabled = !isShowingFirstImpressionSuggestion(context);
-        }
-        if (!parser.dismissSuggestion(suggestion, isSmartSuggestionEnabled)) {
+        if (!parser.dismissSuggestion(suggestion)) {
             return;
         }
         context.getPackageManager().setComponentEnabledSetting(
@@ -155,19 +143,6 @@
                 PackageManager.DONT_KILL_APP);
     }
 
-    private boolean isShowingFirstImpressionSuggestion(Context context) {
-        final String keySetupTime = CATEGORY_FIRST_IMPRESSION + SuggestionParser.SETUP_TIME;
-        final long currentTime = System.currentTimeMillis();
-        final SharedPreferences sharedPrefs = getSharedPrefs(context);
-        if (!sharedPrefs.contains(keySetupTime)) {
-            return true;
-        }
-        final long setupTime = sharedPrefs.getLong(keySetupTime, 0);
-        final long elapsedTime = currentTime - setupTime;
-        Log.d(TAG, "Day " + elapsedTime / DateUtils.DAY_IN_MILLIS + " for first impression");
-        return elapsedTime <= FIRST_IMPRESSION_EXPIRE_DAY_IN_MILLIS;
-    }
-
     @Override
     public String getSuggestionIdentifier(Context context, Tile suggestion) {
         if (suggestion.intent == null || suggestion.intent.getComponent() == null
diff --git a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionFeatureProviderImplTest.java
index 2fde357..59b918a 100644
--- a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionFeatureProviderImplTest.java
@@ -17,8 +17,17 @@
 package com.android.settings.dashboard.suggestions;
 
 
-import android.app.ActivityManager;
+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.anyString;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
 
+import android.app.ActivityManager;
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
@@ -59,18 +68,6 @@
 import java.util.ArrayList;
 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.never;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
-
 @RunWith(SettingsRobolectricTestRunner.class)
 @Config(manifest = TestConfig.MANIFEST_PATH,
         sdk = TestConfig.SDK_VERSION,
@@ -337,7 +334,7 @@
 
     @Test
     public void dismissSuggestion_hasMoreDismissCount_shouldNotDisableComponent() {
-        when(mSuggestionParser.dismissSuggestion(any(Tile.class), anyBoolean()))
+        when(mSuggestionParser.dismissSuggestion(any(Tile.class)))
                 .thenReturn(false);
         mProvider.dismissSuggestion(mContext, mSuggestionParser, mSuggestion);
 
@@ -349,25 +346,6 @@
     }
 
     @Test
-    public void dismissSuggestion_isShowingFirstImpressionType_dismissWithoutSmartSuggestionRule() {
-        mProvider = spy(mProvider);
-        when(mProvider.isSmartSuggestionEnabled(any(Context.class))).thenReturn(true);
-        final SharedPreferences pref = RuntimeEnvironment.application.getSharedPreferences(
-                "test_pref", Context.MODE_PRIVATE);
-        when(mProvider.getSharedPrefs(mContext)).thenReturn(pref);
-        when(mSuggestionParser.dismissSuggestion(any(Tile.class), anyBoolean()))
-                .thenReturn(false);
-
-        mProvider.dismissSuggestion(mContext, mSuggestionParser, mSuggestion);
-
-        verify(mFactory.metricsFeatureProvider).action(
-                eq(mContext),
-                eq(MetricsProto.MetricsEvent.ACTION_SETTINGS_DISMISS_SUGGESTION),
-                anyString());
-        verify(mSuggestionParser).dismissSuggestion(any(Tile.class), eq(false));
-    }
-
-    @Test
     public void dismissSuggestion_noContext_shouldDoNothing() {
         mProvider.dismissSuggestion(null, mSuggestionParser, mSuggestion);
 
@@ -376,7 +354,7 @@
 
     @Test
     public void dismissSuggestion_hasNoMoreDismissCount_shouldDisableComponent() {
-        when(mSuggestionParser.dismissSuggestion(any(Tile.class), anyBoolean()))
+        when(mSuggestionParser.dismissSuggestion(any(Tile.class)))
                 .thenReturn(true);
 
         mProvider.dismissSuggestion(mContext, mSuggestionParser, mSuggestion);
