diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index 559b9ce..cf08f4a 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -159,4 +159,8 @@
     public static class DeviceSettings extends SettingsActivity { /* empty */ }
     public static class PersonalSettings extends SettingsActivity { /* empty */ }
     public static class SystemSettings extends SettingsActivity { /* empty */ }
+
+    // Top level categories for new IA
+    public static class SupportActivity extends SettingsActivity {}
+
 }
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 69b86fe..ecfc373 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -55,6 +55,7 @@
 import com.android.settings.accessibility.AccessibilitySettings;
 import com.android.settings.accessibility.AccessibilitySettingsForSetupWizard;
 import com.android.settings.accessibility.CaptionPropertiesFragment;
+import com.android.settings.accessibility.ToggleDaltonizerPreferenceFragment;
 import com.android.settings.accounts.AccountSettings;
 import com.android.settings.accounts.AccountSyncSettings;
 import com.android.settings.accounts.ChooseAccountActivity;
@@ -74,7 +75,10 @@
 import com.android.settings.bluetooth.BluetoothSettings;
 import com.android.settings.core.instrumentation.SharedPreferencesLogger;
 import com.android.settings.dashboard.DashboardContainerFragment;
+import com.android.settings.dashboard.DashboardFeatureProvider;
+import com.android.settings.dashboard.DashboardSummary;
 import com.android.settings.dashboard.SearchResultsSummary;
+import com.android.settings.dashboard.SupportFragment;
 import com.android.settings.datausage.DataUsageSummary;
 import com.android.settings.deletionhelper.AutomaticStorageManagerSettings;
 import com.android.settings.deviceinfo.ImeiInformation;
@@ -113,6 +117,7 @@
 import com.android.settings.notification.ZenModeScheduleRuleSettings;
 import com.android.settings.notification.ZenModeSettings;
 import com.android.settings.notification.ZenModeVisualInterruptionSettings;
+import com.android.settings.overlay.FeatureFactory;
 import com.android.settings.print.PrintJobSettingsFragment;
 import com.android.settings.print.PrintSettingsFragment;
 import com.android.settings.qstile.DevelopmentTiles;
@@ -294,7 +299,7 @@
             AccessibilitySettings.class.getName(),
             AccessibilitySettingsForSetupWizard.class.getName(),
             CaptionPropertiesFragment.class.getName(),
-            com.android.settings.accessibility.ToggleDaltonizerPreferenceFragment.class.getName(),
+            ToggleDaltonizerPreferenceFragment.class.getName(),
             TextToSpeechSettings.class.getName(),
             StorageSettings.class.getName(),
             PrivateVolumeForget.class.getName(),
@@ -357,7 +362,8 @@
             MasterClear.class.getName(),
             NightDisplaySettings.class.getName(),
             ManageDomainUrls.class.getName(),
-            AutomaticStorageManagerSettings.class.getName()
+            AutomaticStorageManagerSettings.class.getName(),
+            SupportFragment.class.getName()
     };
 
 
@@ -424,6 +430,7 @@
 
     private boolean mNeedToRevertToInitialFragment = false;
 
+    private DashboardFeatureProvider mDashboardFeatureProvider;
     private Intent mResultIntentData;
     private ComponentName mCurrentSuggestion;
 
@@ -533,7 +540,8 @@
     protected void onCreate(Bundle savedState) {
         super.onCreate(savedState);
         long startTime = System.currentTimeMillis();
-
+        mDashboardFeatureProvider =
+                FeatureFactory.getFactory(this).getDashboardFeatureProvider(this);
         // Should happen before any call to getIntent()
         getMetaData();
 
@@ -643,9 +651,13 @@
                 final Bundle args = new Bundle();
                 final String extraName = DashboardContainerFragment.EXTRA_SELECT_SETTINGS_TAB;
                 args.putString(extraName, intent.getStringExtra(extraName));
-
-                switchToFragment(DashboardContainerFragment.class.getName(), args, false, false,
-                        mInitialTitleResId, mInitialTitle, false);
+                if (isDashboardFeatureEnabled()) {
+                    switchToFragment(DashboardSummary.class.getName(), args, false, false,
+                            mInitialTitleResId, mInitialTitle, false);
+                } else {
+                    switchToFragment(DashboardContainerFragment.class.getName(), args, false, false,
+                            mInitialTitleResId, mInitialTitle, false);
+                }
             }
         }
 
@@ -1114,7 +1126,13 @@
 
         if (UserHandle.MU_ENABLED && !isAdmin) {
             // When on restricted users, disable all extra categories (but only the settings ones).
-            List<DashboardCategory> categories = getDashboardCategories();
+            List<DashboardCategory> categories;
+            if (isDashboardFeatureEnabled()) {
+                categories = mDashboardFeatureProvider.getAllCategories();
+            } else {
+                categories = getDashboardCategories();
+            }
+
             for (DashboardCategory category : categories) {
                 for (Tile tile : category.tiles) {
                     ComponentName component = tile.intent.getComponent();
@@ -1165,6 +1183,15 @@
         }
     }
 
+    @Override
+    protected boolean isDashboardFeatureEnabled() {
+        if (mDashboardFeatureProvider == null) {
+            mDashboardFeatureProvider =
+                    FeatureFactory.getFactory(this).getDashboardFeatureProvider(this);
+        }
+        return mDashboardFeatureProvider.isEnabled();
+    }
+
     // give subclasses access to the Next button
     public boolean hasNextButton() {
         return mNextButton != null;
diff --git a/src/com/android/settings/dashboard/DashboardFeatureProvider.java b/src/com/android/settings/dashboard/DashboardFeatureProvider.java
index e4976f5..c093748 100644
--- a/src/com/android/settings/dashboard/DashboardFeatureProvider.java
+++ b/src/com/android/settings/dashboard/DashboardFeatureProvider.java
@@ -15,12 +15,27 @@
  */
 package com.android.settings.dashboard;
 
-import android.content.Context;
+import com.android.settingslib.drawer.DashboardCategory;
+
+import java.util.List;
 
 /**
  * FeatureProvider for dashboard (aka settings homepage).
  */
 public interface DashboardFeatureProvider {
 
-    boolean shouldUseNewIALayout(Context context);
+    /**
+     * Whether or not this feature is enabled.
+     */
+    boolean isEnabled();
+
+    /**
+     * Get tiles (wrapped in {@link DashboardCategory}) for homepage.
+     */
+    DashboardCategory getTilesForHomepage();
+
+    /**
+     * Get all tiles, grouped by category.
+     */
+    List<DashboardCategory> getAllCategories();
 }
diff --git a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
index d07729a..1f0b7f2 100644
--- a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
+++ b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
@@ -18,14 +18,38 @@
 
 import android.content.Context;
 
+import com.android.settingslib.drawer.CategoryKey;
+import com.android.settingslib.drawer.CategoryManager;
+import com.android.settingslib.drawer.DashboardCategory;
+
+import java.util.List;
+
 /**
  * Impl for {@code DashboardFeatureProvider}.
  */
 public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
 
+    protected final Context mContext;
+
+    private final CategoryManager mCategoryManager;
+
+    public DashboardFeatureProviderImpl(Context context) {
+        mContext = context;
+        mCategoryManager = CategoryManager.get();
+    }
+
     @Override
-    public boolean shouldUseNewIALayout(Context context) {
+    public boolean isEnabled() {
         return false;
     }
 
+    @Override
+    public DashboardCategory getTilesForHomepage() {
+        return mCategoryManager.getTilesByCategory(mContext, CategoryKey.CATEGORY_HOMEPAGE);
+    }
+
+    @Override
+    public List<DashboardCategory> getAllCategories() {
+        return mCategoryManager.getCategories(mContext);
+    }
 }
diff --git a/src/com/android/settings/dashboard/DashboardSummary.java b/src/com/android/settings/dashboard/DashboardSummary.java
index fb8c959..d63eb0f 100644
--- a/src/com/android/settings/dashboard/DashboardSummary.java
+++ b/src/com/android/settings/dashboard/DashboardSummary.java
@@ -35,6 +35,7 @@
 import com.android.settings.dashboard.conditional.ConditionAdapterUtils;
 import com.android.settings.dashboard.conditional.ConditionManager;
 import com.android.settings.dashboard.conditional.FocusRecyclerView;
+import com.android.settings.overlay.FeatureFactory;
 import com.android.settingslib.SuggestionParser;
 import com.android.settingslib.drawer.DashboardCategory;
 import com.android.settingslib.drawer.SettingsDrawerActivity;
@@ -50,7 +51,7 @@
     private static final boolean DEBUG_TIMING = false;
     private static final String TAG = "DashboardSummary";
 
-    public static final String[] INITIAL_ITEMS = new String[] {
+    public static final String[] INITIAL_ITEMS = new String[]{
             Settings.WifiSettingsActivity.class.getName(),
             Settings.BluetoothSettingsActivity.class.getName(),
             Settings.DataUsageSummaryActivity.class.getName(),
@@ -74,6 +75,7 @@
     private SuggestionsChecks mSuggestionsChecks;
     private ArrayList<String> mSuggestionsShownLogged;
     private ArrayList<String> mSuggestionsHiddenLogged;
+    private DashboardFeatureProvider mDashboardFeatureProvider;
 
     @Override
     public int getMetricsCategory() {
@@ -84,10 +86,18 @@
     public void onCreate(Bundle savedInstanceState) {
         long startTime = System.currentTimeMillis();
         super.onCreate(savedInstanceState);
+        final Activity activity = getActivity();
+        mDashboardFeatureProvider = FeatureFactory.getFactory(activity)
+                .getDashboardFeatureProvider(activity);
 
-        List<DashboardCategory> categories =
-                ((SettingsActivity) getActivity()).getDashboardCategories();
-        mSummaryLoader = new SummaryLoader(getActivity(), categories);
+        if (mDashboardFeatureProvider.isEnabled()) {
+            mSummaryLoader = new SummaryLoader(activity,
+                    mDashboardFeatureProvider.getTilesForHomepage());
+        } else {
+            mSummaryLoader = new SummaryLoader(activity,
+                    ((SettingsActivity) getActivity()).getDashboardCategories());
+        }
+
         Context context = getContext();
         mConditionManager = ConditionManager.get(context, false);
         mSuggestionParser = new SuggestionParser(context,
@@ -102,8 +112,10 @@
             mSuggestionsHiddenLogged =
                     savedInstanceState.getStringArrayList(EXTRA_SUGGESTION_HIDDEN_LOGGED);
         }
-        if (DEBUG_TIMING) Log.d(TAG, "onCreate took " + (System.currentTimeMillis() - startTime)
-                + " ms");
+        if (DEBUG_TIMING) {
+            Log.d(TAG, "onCreate took " + (System.currentTimeMillis() - startTime)
+                    + " ms");
+        }
     }
 
     @Override
@@ -124,8 +136,10 @@
                 mMetricsFeatureProvider.visible(getContext(), c.getMetricsConstant());
             }
         }
-        if (DEBUG_TIMING) Log.d(TAG, "onResume took " + (System.currentTimeMillis() - startTime)
-                + " ms");
+        if (DEBUG_TIMING) {
+            Log.d(TAG, "onResume took " + (System.currentTimeMillis() - startTime)
+                    + " ms");
+        }
     }
 
     @Override
@@ -163,13 +177,15 @@
         } else {
             mConditionManager.remListener(this);
         }
-        if (DEBUG_TIMING) Log.d(TAG, "onWindowFocusChanged took "
-                + (System.currentTimeMillis() - startTime) + " ms");
+        if (DEBUG_TIMING) {
+            Log.d(TAG, "onWindowFocusChanged took "
+                    + (System.currentTimeMillis() - startTime) + " ms");
+        }
     }
 
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
-                             Bundle savedInstanceState) {
+            Bundle savedInstanceState) {
         return inflater.inflate(R.layout.dashboard, container, false);
     }
 
@@ -204,8 +220,10 @@
         mDashboard.setAdapter(mAdapter);
         mSummaryLoader.setAdapter(mAdapter);
         ConditionAdapterUtils.addDismiss(mDashboard);
-        if (DEBUG_TIMING) Log.d(TAG, "onViewCreated took "
-                + (System.currentTimeMillis() - startTime) + " ms");
+        if (DEBUG_TIMING) {
+            Log.d(TAG, "onViewCreated took "
+                    + (System.currentTimeMillis() - startTime) + " ms");
+        }
         rebuildUI();
     }
 
@@ -259,9 +277,18 @@
             if (activity == null) {
                 return;
             }
-            List<DashboardCategory> categories =
-                    ((SettingsActivity) activity).getDashboardCategories();
-            mAdapter.setCategoriesAndSuggestions(categories, tiles);
+
+            if (mDashboardFeatureProvider.isEnabled()) {
+                // Temporary hack to wrap homepage category into a list. Soon we will create adapter
+                // API that takes a single category.
+                List<DashboardCategory> categories = new ArrayList<>();
+                categories.add(mDashboardFeatureProvider.getTilesForHomepage());
+                mAdapter.setCategoriesAndSuggestions(categories, tiles);
+            } else {
+                mAdapter.setCategoriesAndSuggestions(
+                        ((SettingsActivity) activity).getDashboardCategories(), tiles);
+            }
+
         }
     }
 }
diff --git a/src/com/android/settings/dashboard/SummaryLoader.java b/src/com/android/settings/dashboard/SummaryLoader.java
index 4232852..d55ec06 100644
--- a/src/com/android/settings/dashboard/SummaryLoader.java
+++ b/src/com/android/settings/dashboard/SummaryLoader.java
@@ -30,6 +30,7 @@
 import android.util.Log;
 
 import com.android.settings.SettingsActivity;
+import com.android.settings.overlay.FeatureFactory;
 import com.android.settingslib.drawer.DashboardCategory;
 import com.android.settingslib.drawer.SettingsDrawerActivity;
 import com.android.settingslib.drawer.Tile;
@@ -72,6 +73,19 @@
         }
     }
 
+    public SummaryLoader(Activity activity, DashboardCategory categories) {
+        mHandler = new Handler();
+        mWorkerThread = new HandlerThread("SummaryLoader", Process.THREAD_PRIORITY_BACKGROUND);
+        mWorkerThread.start();
+        mWorker = new Worker(mWorkerThread.getLooper());
+        mActivity = activity;
+        List<Tile> tiles = categories.tiles;
+        for (int j = 0; j < tiles.size(); j++) {
+            Tile tile = tiles.get(j);
+            mWorker.obtainMessage(Worker.MSG_GET_PROVIDER, tile).sendToTarget();
+        }
+    }
+
     public void release() {
         mWorkerThread.quitSafely();
         // Make sure we aren't listening.
@@ -83,7 +97,7 @@
     }
 
     public void setSummary(SummaryProvider provider, final CharSequence summary) {
-        final ComponentName component= mSummaryMap.get(provider);
+        final ComponentName component = mSummaryMap.get(provider);
         mHandler.post(new Runnable() {
             @Override
             public void run() {
@@ -95,9 +109,18 @@
                     }
                     return;
                 }
-                final List<DashboardCategory> categories =
-                        ((SettingsDrawerActivity) mActivity).getDashboardCategories();
-                final Tile tile = getTileFromCategory(categories, component);
+                final Tile tile;
+                final DashboardFeatureProvider dashboardFeatureProvider =
+                        FeatureFactory.getFactory(mActivity).getDashboardFeatureProvider(mActivity);
+                if (dashboardFeatureProvider.isEnabled()) {
+                    tile = getTileFromCategory(dashboardFeatureProvider.getTilesForHomepage(),
+                            component);
+                } else {
+                    tile = getTileFromCategory(
+                            ((SettingsDrawerActivity) mActivity).getDashboardCategories(),
+                            component);
+                }
+
                 if (tile == null) {
                     if (DEBUG) {
                         Log.d(TAG, "Can't find tile for " + component);
@@ -214,12 +237,20 @@
         final int categorySize = categories.size();
         for (int i = 0; i < categorySize; i++) {
             final DashboardCategory category = categories.get(i);
-            final int tileCount = category.tiles.size();
-            for (int j = 0; j < tileCount; j++) {
-                final Tile tile = category.tiles.get(j);
-                if (component.equals(tile.intent.getComponent())) {
-                    return tile;
-                }
+            final Tile tile = getTileFromCategory(category, component);
+            if (tile != null) {
+                return tile;
+            }
+        }
+        return null;
+    }
+
+    private Tile getTileFromCategory(DashboardCategory category, ComponentName component) {
+        final int tileCount = category.tiles.size();
+        for (int j = 0; j < tileCount; j++) {
+            final Tile tile = category.tiles.get(j);
+            if (component.equals(tile.intent.getComponent())) {
+                return tile;
             }
         }
         return null;
diff --git a/src/com/android/settings/overlay/FeatureFactory.java b/src/com/android/settings/overlay/FeatureFactory.java
index 7099b3f..dd3e9c8 100644
--- a/src/com/android/settings/overlay/FeatureFactory.java
+++ b/src/com/android/settings/overlay/FeatureFactory.java
@@ -68,7 +68,7 @@
 
     public abstract PowerUsageFeatureProvider getPowerUsageFeatureProvider();
 
-    public abstract DashboardFeatureProvider getDashboardFeatureProvider();
+    public abstract DashboardFeatureProvider getDashboardFeatureProvider(Context context);
 
     public static final class FactoryNotFoundException extends RuntimeException {
         public FactoryNotFoundException(Throwable throwable) {
diff --git a/src/com/android/settings/overlay/FeatureFactoryImpl.java b/src/com/android/settings/overlay/FeatureFactoryImpl.java
index 8f71363..65015c3 100644
--- a/src/com/android/settings/overlay/FeatureFactoryImpl.java
+++ b/src/com/android/settings/overlay/FeatureFactoryImpl.java
@@ -53,9 +53,9 @@
     }
 
     @Override
-    public DashboardFeatureProvider getDashboardFeatureProvider() {
+    public DashboardFeatureProvider getDashboardFeatureProvider(Context context) {
         if (mDashboardFeatureProvider == null) {
-            mDashboardFeatureProvider = new DashboardFeatureProviderImpl();
+            mDashboardFeatureProvider = new DashboardFeatureProviderImpl(context);
         }
         return mDashboardFeatureProvider;
     }
