diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index b661a1e..90d8793 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -864,30 +864,6 @@
                 android:value="true" />
         </activity>
 
-        <activity android:name="Settings$HomeSettingsActivity"
-                android:label="@string/home_settings"
-                android:icon="@drawable/ic_settings_home"
-                android:taskAffinity="">
-            <intent-filter android:priority="1">
-                <action android:name="android.settings.HOME_SETTINGS" />
-                <category android:name="android.intent.category.DEFAULT" />
-            </intent-filter>
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <category android:name="android.intent.category.VOICE_LAUNCH" />
-            </intent-filter>
-            <intent-filter android:priority="10">
-                <action android:name="com.android.settings.action.SETTINGS" />
-            </intent-filter>
-            <meta-data android:name="com.android.settings.category"
-                android:value="com.android.settings.category.device" />
-            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
-                android:value="com.android.settings.HomeSettings" />
-            <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
-                android:value="true" />
-        </activity>
-
         <activity android:name="Settings$DisplaySettingsActivity"
                 android:label="@string/display_settings"
                 android:icon="@drawable/ic_settings_display"
@@ -2711,6 +2687,10 @@
                 <action android:name="android.settings.MANAGE_DEFAULT_APPS_SETTINGS" />
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
+            <intent-filter>
+                <action android:name="android.settings.HOME_SETTINGS" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
             <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                        android:value="com.android.settings.applications.ManageDefaultApps" />
             <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
diff --git a/res/layout/app_preference_item.xml b/res/layout/app_preference_item.xml
index b02f835..0ad08cc 100755
--- a/res/layout/app_preference_item.xml
+++ b/res/layout/app_preference_item.xml
@@ -18,35 +18,55 @@
 -->
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="?android:attr/listPreferredItemHeight"
+    android:layout_height="wrap_content"
+    android:minHeight="?android:attr/listPreferredItemHeight"
     android:padding="6dip">
     <ImageView
-        android:id="@+id/app_image"
+        android:id="@android:id/icon"
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:adjustViewBounds="true"
         android:padding="6dip"
-    />
-    <TextView
-        android:id="@+id/app_label"
+        android:duplicateParentState="true"
+        />
+    <LinearLayout
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:minHeight="?android:attr/listPreferredItemHeight"
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:textColor="?android:attr/textColorAlertDialogListItem"
-        android:gravity="center_vertical"
-        android:paddingEnd="7dip"
-        android:ellipsize="marquee"
-    />
+        android:layout_gravity="center_vertical"
+        android:duplicateParentState="true"
+        android:orientation="vertical">
+        <TextView
+            android:id="@android:id/title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:textColor="?android:attr/textColorAlertDialogListItem"
+            android:gravity="center_vertical"
+            android:paddingEnd="7dip"
+            android:ellipsize="marquee"
+            android:duplicateParentState="true"
+            />
+        <TextView
+            android:id="@android:id/summary"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:gravity="center_vertical"
+            android:paddingEnd="7dip"
+            android:ellipsize="marquee"
+            android:visibility="gone"
+            android:duplicateParentState="true"
+            />
+    </LinearLayout>
     <TextView
         android:id="@+id/default_label"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:minHeight="?android:attr/listPreferredItemHeight"
         android:textAppearance="?android:attr/textAppearanceSmall"
-        android:gravity="center_vertical"
+        android:layout_gravity="center_vertical"
         android:text="@string/default_app"
         android:visibility="gone"
         android:paddingEnd="7dip"
-    />
+        android:duplicateParentState="true"
+        />
 </LinearLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f94893d..9336fee 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -7001,4 +7001,10 @@
     <!-- Title for switch to allow app unrestricted data usage [CHAR LIMIT=30] -->
     <string name="unrestricted_app_summary">Allow unrestricted data access when Data Saver is on</string>
 
+    <!-- Button to switch the default home app [CHAR LIMIT=60] -->
+    <string name="home_app">Home app</string>
+
+    <!-- No default home set summary [CHAR LIMIT=NONE] -->
+    <string name="no_default_home">No default Home</string>
+
 </resources>
diff --git a/res/xml/default_apps.xml b/res/xml/default_apps.xml
index a38ef4a..76d0e8c 100644
--- a/res/xml/default_apps.xml
+++ b/res/xml/default_apps.xml
@@ -25,6 +25,12 @@
         android:title="@string/assist_and_voice_input_title"
         />
 
+    <com.android.settings.applications.DefaultHomePreference
+            android:key="default_home"
+            android:title="@string/home_app"
+            android:summary="@string/no_default_home"
+            />
+
     <com.android.settings.applications.DefaultBrowserPreference
             android:key="default_browser"
             android:title="@string/default_browser_title"
diff --git a/src/com/android/settings/AppListPreference.java b/src/com/android/settings/AppListPreference.java
index 4d24d7f..1c1ccd7 100644
--- a/src/com/android/settings/AppListPreference.java
+++ b/src/com/android/settings/AppListPreference.java
@@ -16,7 +16,6 @@
 
 package com.android.settings;
 
-import android.app.Activity;
 import android.app.AlertDialog;
 import android.content.ComponentName;
 import android.content.Context;
@@ -50,6 +49,7 @@
 
     private Drawable[] mEntryDrawables;
     private boolean mShowItemNone = false;
+    private CharSequence[] mSummaries;
 
     public class AppArrayAdapter extends ArrayAdapter<CharSequence> {
         private Drawable[] mImageDrawables = null;
@@ -63,16 +63,30 @@
         }
 
         @Override
+        public boolean isEnabled(int position) {
+            return mSummaries == null || mSummaries[position] == null;
+        }
+
+        @Override
         public View getView(int position, View convertView, ViewGroup parent) {
             LayoutInflater inflater = LayoutInflater.from(getContext());
             View view = inflater.inflate(R.layout.app_preference_item, parent, false);
-            TextView textView = (TextView) view.findViewById(R.id.app_label);
+            TextView textView = (TextView) view.findViewById(android.R.id.title);
             textView.setText(getItem(position));
             if (position == mSelectedIndex) {
                 view.findViewById(R.id.default_label).setVisibility(View.VISIBLE);
             }
-            ImageView imageView = (ImageView)view.findViewById(R.id.app_image);
+            ImageView imageView = (ImageView) view.findViewById(android.R.id.icon);
             imageView.setImageDrawable(mImageDrawables[position]);
+            // Summaries are describing why a item is disabled, so anything with a summary
+            // is not enabled.
+            boolean enabled = mSummaries == null || mSummaries[position] == null;
+            view.setEnabled(enabled);
+            if (!enabled) {
+                TextView summary = (TextView) view.findViewById(android.R.id.summary);
+                summary.setText(mSummaries[position]);
+                summary.setVisibility(View.VISIBLE);
+            }
             return view;
         }
     }
@@ -133,6 +147,12 @@
     }
 
     public void setComponentNames(ComponentName[] componentNames, ComponentName defaultCN) {
+        setComponentNames(componentNames, defaultCN, null);
+    }
+
+    public void setComponentNames(ComponentName[] componentNames, ComponentName defaultCN,
+            CharSequence[] summaries) {
+        mSummaries = summaries;
         // Look up all package names in PackageManager. Skip ones we can't find.
         PackageManager pm = getContext().getPackageManager();
         final int entryCount = componentNames.length + (mShowItemNone ? 1 : 0);
@@ -192,7 +212,7 @@
     @Override
     protected Parcelable onSaveInstanceState() {
         Parcelable superState = super.onSaveInstanceState();
-        return new SavedState(getEntryValues(), getValue(), mShowItemNone, superState);
+        return new SavedState(getEntryValues(), getValue(), mSummaries, mShowItemNone, superState);
     }
 
     @Override
@@ -201,6 +221,7 @@
             SavedState savedState = (SavedState) state;
             mShowItemNone = savedState.showItemNone;
             setPackageNames(savedState.entryValues, savedState.value);
+            mSummaries = savedState.summaries;
             super.onRestoreInstanceState(savedState.superState);
         } else {
             super.onRestoreInstanceState(state);
@@ -213,13 +234,15 @@
         public final CharSequence value;
         public final boolean showItemNone;
         public final Parcelable superState;
+        public final CharSequence[] summaries;
 
-        public SavedState(CharSequence[] entryValues, CharSequence value, boolean showItemNone,
-                Parcelable superState) {
+        public SavedState(CharSequence[] entryValues, CharSequence value, CharSequence[] summaries,
+                boolean showItemNone, Parcelable superState) {
             this.entryValues = entryValues;
             this.value = value;
             this.showItemNone = showItemNone;
             this.superState = superState;
+            this.summaries = summaries;
         }
 
         @Override
@@ -233,6 +256,7 @@
             dest.writeCharSequence(value);
             dest.writeInt(showItemNone ? 1 : 0);
             dest.writeParcelable(superState, flags);
+            dest.writeCharSequenceArray(summaries);
         }
 
         public static Creator<SavedState> CREATOR = new Creator<SavedState>() {
@@ -242,7 +266,8 @@
                 CharSequence value = source.readCharSequence();
                 boolean showItemNone = source.readInt() != 0;
                 Parcelable superState = source.readParcelable(getClass().getClassLoader());
-                return new SavedState(entryValues, value, showItemNone, superState);
+                CharSequence[] summaries = source.readCharSequenceArray();
+                return new SavedState(entryValues, value, summaries, showItemNone, superState);
             }
 
             @Override
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index dc134ff..db9d9c3 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -29,7 +29,6 @@
 import android.content.pm.ActivityInfo;
 import android.content.pm.PackageManager;
 import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.pm.ResolveInfo;
 import android.content.res.Configuration;
 import android.nfc.NfcAdapter;
 import android.os.AsyncTask;
@@ -114,8 +113,8 @@
 import com.android.settings.wifi.WifiSettings;
 import com.android.settings.wifi.p2p.WifiP2pSettings;
 import com.android.settingslib.drawer.DashboardCategory;
-import com.android.settingslib.drawer.Tile;
 import com.android.settingslib.drawer.SettingsDrawerActivity;
+import com.android.settingslib.drawer.Tile;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -380,7 +379,6 @@
     private static final String MSG_DATA_FORCE_REFRESH = "msg_data_force_refresh";
 
     private boolean mNeedToRevertToInitialFragment = false;
-    private int mHomeActivitiesCount = 1;
 
     private Intent mResultIntentData;
     private ComponentName mCurrentSuggestion;
@@ -561,8 +559,6 @@
 
             mDisplayHomeAsUpEnabled = savedState.getBoolean(SAVE_KEY_SHOW_HOME_AS_UP);
             mDisplaySearch = savedState.getBoolean(SAVE_KEY_SHOW_SEARCH);
-            mHomeActivitiesCount = savedState.getInt(SAVE_KEY_HOME_ACTIVITIES_COUNT,
-                    1 /* one home activity by default */);
         } else {
             if (!mIsShowingDashboard) {
                 mDisplaySearch = false;
@@ -651,17 +647,10 @@
             }
         }
 
-        mHomeActivitiesCount = getHomeActivitiesCount();
         if (DEBUG_TIMING) Log.d(LOG_TAG, "onCreate took " + (System.currentTimeMillis() - startTime)
                 + " ms");
     }
 
-    private int getHomeActivitiesCount() {
-        final ArrayList<ResolveInfo> homeApps = new ArrayList<ResolveInfo>();
-        getPackageManager().getHomeActivities(homeApps);
-        return homeApps.size();
-    }
-
     private void setTitleFromIntent(Intent intent) {
         final int initialTitleResId = intent.getIntExtra(EXTRA_SHOW_FRAGMENT_TITLE_RESID, -1);
         if (initialTitleResId > 0) {
@@ -751,8 +740,6 @@
             String query = (mSearchView != null) ? mSearchView.getQuery().toString() : EMPTY_QUERY;
             outState.putString(SAVE_KEY_SEARCH_QUERY, query);
         }
-
-        outState.putInt(SAVE_KEY_HOME_ACTIVITIES_COUNT, mHomeActivitiesCount);
     }
 
     @Override
@@ -1022,10 +1009,6 @@
                 mBatteryPresent, isAdmin, pm);
 
         setTileEnabled(new ComponentName(packageName,
-                Settings.HomeSettingsActivity.class.getName()),
-                updateHomeSettingTiles(), isAdmin, pm);
-
-        setTileEnabled(new ComponentName(packageName,
                 Settings.UserSettingsActivity.class.getName()),
                 UserHandle.MU_ENABLED && UserManager.supportsMultipleUsers()
                 && !Utils.isMonkeyRunning(), isAdmin, pm);
@@ -1081,27 +1064,6 @@
         }
     }
 
-    private boolean updateHomeSettingTiles() {
-        // Once we decide to show Home settings, keep showing it forever
-        SharedPreferences sp = getSharedPreferences(HomeSettings.HOME_PREFS, Context.MODE_PRIVATE);
-        if (sp.getBoolean(HomeSettings.HOME_PREFS_DO_SHOW, false)) {
-            return true;
-        }
-
-        try {
-            mHomeActivitiesCount = getHomeActivitiesCount();
-            if (mHomeActivitiesCount < 2) {
-                return false;
-            }
-        } catch (Exception e) {
-            // Can't look up the home activity; bail on configuring the icon
-            Log.w(LOG_TAG, "Problem looking up home activity!", e);
-        }
-
-        sp.edit().putBoolean(HomeSettings.HOME_PREFS_DO_SHOW, true).apply();
-        return true;
-    }
-
     private void getMetaData() {
         try {
             ActivityInfo ai = getPackageManager().getActivityInfo(getComponentName(),
diff --git a/src/com/android/settings/SmsDefaultDialog.java b/src/com/android/settings/SmsDefaultDialog.java
index a1af021..e38c9b8 100644
--- a/src/com/android/settings/SmsDefaultDialog.java
+++ b/src/com/android/settings/SmsDefaultDialog.java
@@ -187,14 +187,14 @@
             Item item = ((Item) getItem(position));
             LayoutInflater inflater = getLayoutInflater();
             View view = inflater.inflate(R.layout.app_preference_item, parent, false);
-            TextView textView = (TextView) view.findViewById(R.id.app_label);
+            TextView textView = (TextView) view.findViewById(android.R.id.title);
             textView.setText(item.label);
             if (position == mSelectedIndex) {
                 view.findViewById(R.id.default_label).setVisibility(View.VISIBLE);
             } else {
                 view.findViewById(R.id.default_label).setVisibility(View.GONE);
             }
-            ImageView imageView = (ImageView)view.findViewById(R.id.app_image);
+            ImageView imageView = (ImageView)view.findViewById(android.R.id.icon);
             imageView.setImageDrawable(item.icon);
             return view;
         }
diff --git a/src/com/android/settings/applications/DefaultHomePreference.java b/src/com/android/settings/applications/DefaultHomePreference.java
new file mode 100644
index 0000000..7426ce6
--- /dev/null
+++ b/src/com/android/settings/applications/DefaultHomePreference.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the
+ * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package com.android.settings.applications;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.pm.ActivityInfo;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.content.pm.UserInfo;
+import android.os.Build;
+import android.os.UserManager;
+import android.util.AttributeSet;
+import com.android.settings.AppListPreference;
+import com.android.settings.R;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class DefaultHomePreference extends AppListPreference {
+
+    private final ArrayList<ComponentName> mAllHomeComponents = new ArrayList<>();
+    private final IntentFilter mHomeFilter;
+
+    public DefaultHomePreference(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        mHomeFilter = new IntentFilter(Intent.ACTION_MAIN);
+        mHomeFilter.addCategory(Intent.CATEGORY_HOME);
+        mHomeFilter.addCategory(Intent.CATEGORY_DEFAULT);
+        refreshHomeOptions();
+    }
+
+    @Override
+    public void performClick() {
+        refreshHomeOptions();
+        super.performClick();
+    }
+
+    @Override
+    protected boolean persistString(String value) {
+        if (value != null) {
+            ComponentName component = ComponentName.unflattenFromString(value);
+            getContext().getPackageManager().replacePreferredActivity(mHomeFilter,
+                    IntentFilter.MATCH_CATEGORY_EMPTY,
+                    mAllHomeComponents.toArray(new ComponentName[0]), component);
+            setSummary(getEntry());
+        }
+        return super.persistString(value);
+    }
+
+    public void refreshHomeOptions() {
+        final String myPkg = getContext().getPackageName();
+        ArrayList<ResolveInfo> homeActivities = new ArrayList<ResolveInfo>();
+        PackageManager pm = getContext().getPackageManager();
+        ComponentName currentDefaultHome  = pm.getHomeActivities(homeActivities);
+        ArrayList<ComponentName> components = new ArrayList<>();
+        mAllHomeComponents.clear();
+        List<CharSequence> summaries = new ArrayList<>();
+
+        boolean mustSupportManagedProfile = hasManagedProfile();
+        for (int i = 0; i < homeActivities.size(); i++) {
+            final ResolveInfo candidate = homeActivities.get(i);
+            final ActivityInfo info = candidate.activityInfo;
+            ComponentName activityName = new ComponentName(info.packageName, info.name);
+            mAllHomeComponents.add(activityName);
+            if (info.packageName.equals(myPkg)) {
+                continue;
+            }
+            components.add(activityName);
+            if (mustSupportManagedProfile && !launcherHasManagedProfilesFeature(candidate, pm)) {
+                summaries.add(getContext().getString(R.string.home_work_profile_not_supported));
+            } else {
+                summaries.add(null);
+            }
+        }
+        setComponentNames(components.toArray(new ComponentName[0]), currentDefaultHome,
+                summaries.toArray(new CharSequence[0]));
+    }
+
+    private boolean launcherHasManagedProfilesFeature(ResolveInfo resolveInfo, PackageManager pm) {
+        try {
+            ApplicationInfo appInfo = pm.getApplicationInfo(
+                    resolveInfo.activityInfo.packageName, 0 /* default flags */);
+            return versionNumberAtLeastL(appInfo.targetSdkVersion);
+        } catch (PackageManager.NameNotFoundException e) {
+            return false;
+        }
+    }
+
+    private boolean versionNumberAtLeastL(int versionNumber) {
+        return versionNumber >= Build.VERSION_CODES.LOLLIPOP;
+    }
+
+    private boolean hasManagedProfile() {
+        UserManager userManager = getContext().getSystemService(UserManager.class);
+        List<UserInfo> profiles = userManager.getProfiles(getContext().getUserId());
+        for (UserInfo userInfo : profiles) {
+            if (userInfo.isManagedProfile()) return true;
+        }
+        return false;
+    }
+
+}
