diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 7034dc3..fd22c63 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2275,6 +2275,8 @@
             </intent-filter>
             <meta-data android:name="com.android.settings.category"
                 android:value="com.android.settings.category.device" />
+            <meta-data android:name="com.android.settings.iacategory"
+                       android:value="com.android.settings.category.homepage" />
             <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                 android:value="com.android.settings.fuelgauge.PowerUsageSummary" />
         </activity>
@@ -3030,6 +3032,22 @@
                        android:value="com.android.settings.deletionhelper.AutomaticStorageManagerSettings" />
         </activity>
 
+        <!-- Information architecture host activities -->
+        <activity
+            android:name=".Settings$SupportActivity"
+            android:label="@string/page_tab_title_support"
+            android:icon="@drawable/ic_help_24dp">
+            <intent-filter android:priority="-1">
+                <action android:name="com.android.settings.action.SETTINGS" />
+            </intent-filter>
+            <meta-data android:name="com.android.settings.iacategory"
+                       android:value="com.android.settings.category.homepage" />
+            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+                       android:value="com.android.settings.dashboard.SupportFragment"/>
+            <meta-data android:name="com.android.settings.summary"
+                       android:resource="@string/help_label" />
+        </activity>
+
         <service
             android:name=".SettingsDumpService"
             android:exported="true"
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;
     }
