Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5cbcfb07 authored by Vaibhav Devmurari's avatar Vaibhav Devmurari Committed by Android (Google) Code Review
Browse files

Merge "Fix: User main user for personal profile" into main

parents 6f72f454 1c7bed6c
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -88,8 +88,14 @@ public class NewKeyboardLayoutEnabledLocalesFragment extends DashboardFragment
                break;
            }
            case ProfileSelectFragment.ProfileType.PERSONAL: {
                final UserHandle primaryUser = userManager.getPrimaryUser().getUserHandle();
                newUserId = primaryUser.getIdentifier();
                // Use the parent user of the current user if the current user is profile.
                final UserHandle currentUser = UserHandle.of(currentUserId);
                final UserHandle userProfileParent = userManager.getProfileParent(currentUser);
                if (userProfileParent != null) {
                    newUserId = userProfileParent.getIdentifier();
                } else {
                    newUserId = currentUserId;
                }
                break;
            }
            default: