diff --git a/res/values/strings.xml b/res/values/strings.xml
index 5d4487c..466834c 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -2268,6 +2268,8 @@
     <string name="accessibility_category_work">Work profile accounts - <xliff:g id="managed_by" example="Managed by Corporate application">%s</xliff:g></string>
     <!-- Content description for personal profile accounts group [CHAR LIMIT=NONE] -->
     <string name="accessibility_category_personal">Personal profile accounts</string>
+    <!-- Content description for personal clone accounts group [CHAR LIMIT=NONE] -->
+    <string name="accessibility_category_clone">Clone profile accounts</string>
     <!-- Content description for work profile details page title [CHAR LIMIT=NONE] -->
     <string name="accessibility_work_account_title">Work account - <xliff:g id="managed_by" example="Email provider">%s</xliff:g></string>
     <!-- Content description for personal profile details page title [CHAR LIMIT=NONE] -->
diff --git a/src/com/android/settings/accounts/AccountPreferenceController.java b/src/com/android/settings/accounts/AccountPreferenceController.java
index 8c717f0..cdaba20 100644
--- a/src/com/android/settings/accounts/AccountPreferenceController.java
+++ b/src/com/android/settings/accounts/AccountPreferenceController.java
@@ -16,8 +16,10 @@
 
 package com.android.settings.accounts;
 
+import static android.app.admin.DevicePolicyResources.Strings.Settings.ACCESSIBILITY_CATEGORY_CLONE;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.ACCESSIBILITY_CATEGORY_PERSONAL;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.ACCESSIBILITY_CATEGORY_WORK;
+import static android.app.admin.DevicePolicyResources.Strings.Settings.CLONE_CATEGORY_HEADER;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.MANAGED_BY;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.MANAGED_PROFILE_SETTINGS_TITLE;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.PERSONAL_CATEGORY_HEADER;
@@ -349,28 +351,34 @@
             preferenceGroup.setContentDescription(title);
         } else if (userInfo.isManagedProfile()) {
             if (mType == ProfileSelectFragment.ProfileType.ALL) {
-                preferenceGroup.setTitle(
-                        mDpm.getResources().getString(WORK_CATEGORY_HEADER,
-                                () -> mContext.getString(R.string.category_work)));
+                setCategoryTitleFromDevicePolicyResource(preferenceGroup, WORK_CATEGORY_HEADER,
+                        R.string.category_work);
                 final String workGroupSummary = getWorkGroupSummary(context, userInfo);
                 preferenceGroup.setSummary(workGroupSummary);
-                preferenceGroup.setContentDescription(
-                        mDpm.getResources().getString(ACCESSIBILITY_CATEGORY_WORK, () ->
-                        mContext.getString(
-                                R.string.accessibility_category_work, workGroupSummary)));
+                setContentDescriptionFromDevicePolicyResource(preferenceGroup,
+                        ACCESSIBILITY_CATEGORY_WORK, R.string.accessibility_category_work,
+                        workGroupSummary);
             }
             profileData.removeWorkProfilePreference = newRemoveWorkProfilePreference();
             mHelper.enforceRestrictionOnPreference(profileData.removeWorkProfilePreference,
                     DISALLOW_REMOVE_MANAGED_PROFILE, UserHandle.myUserId());
             profileData.managedProfilePreference = newManagedProfileSettings();
-        } else {
+        } else if (userInfo.isCloneProfile()) {
             if (mType == ProfileSelectFragment.ProfileType.ALL) {
-                preferenceGroup.setTitle(
-                        mDpm.getResources().getString(PERSONAL_CATEGORY_HEADER,
-                                () -> mContext.getString(R.string.category_personal)));
-                preferenceGroup.setContentDescription(
-                        mDpm.getResources().getString(ACCESSIBILITY_CATEGORY_PERSONAL, () ->
-                        mContext.getString(R.string.accessibility_category_personal)));
+                setCategoryTitleFromDevicePolicyResource(preferenceGroup, CLONE_CATEGORY_HEADER,
+                        R.string.category_clone);
+                setContentDescriptionFromDevicePolicyResource(preferenceGroup,
+                        ACCESSIBILITY_CATEGORY_CLONE, R.string.accessibility_category_clone,
+                        null);
+            }
+        } else {
+            // Primary Profile
+            if (mType == ProfileSelectFragment.ProfileType.ALL) {
+                setCategoryTitleFromDevicePolicyResource(preferenceGroup, PERSONAL_CATEGORY_HEADER,
+                        R.string.category_personal);
+                setContentDescriptionFromDevicePolicyResource(preferenceGroup,
+                        ACCESSIBILITY_CATEGORY_PERSONAL, R.string.accessibility_category_personal,
+                        null);
             }
         }
         final PreferenceScreen screen = mFragment.getPreferenceScreen();
@@ -381,13 +389,33 @@
         if (userInfo.isEnabled()) {
             profileData.authenticatorHelper = new AuthenticatorHelper(context,
                     userInfo.getUserHandle(), this);
-            profileData.addAccountPreference = newAddAccountPreference();
-            mHelper.enforceRestrictionOnPreference(profileData.addAccountPreference,
-                    DISALLOW_MODIFY_ACCOUNTS, userInfo.id);
+            if (!userInfo.isCloneProfile()) {
+                profileData.addAccountPreference = newAddAccountPreference();
+                mHelper.enforceRestrictionOnPreference(profileData.addAccountPreference,
+                        DISALLOW_MODIFY_ACCOUNTS, userInfo.id);
+            }
         }
         mProfiles.put(userInfo.id, profileData);
     }
 
+    private void setCategoryTitleFromDevicePolicyResource(
+            AccessiblePreferenceCategory preferenceGroup, String stringId, int resourceIdentifier) {
+        preferenceGroup.setTitle(
+                mDpm.getResources().getString(stringId,
+                        () -> mContext.getString(resourceIdentifier)));
+    }
+
+    private void setContentDescriptionFromDevicePolicyResource(
+            AccessiblePreferenceCategory preferenceGroup, String stringId, int resourceIdentifier,
+            String formatArgs) {
+        preferenceGroup.setContentDescription(mDpm.getResources().getString(stringId, () -> {
+            if (formatArgs != null) {
+                return mContext.getString(resourceIdentifier, formatArgs);
+            }
+            return mContext.getString(resourceIdentifier);
+        }));
+    }
+
     private RestrictedPreference newAddAccountPreference() {
         RestrictedPreference preference =
                 new RestrictedPreference(mFragment.getPreferenceManager().getContext());
