Merge "Fix: User main user for personal profile" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
5cbcfb07fe
@@ -88,8 +88,14 @@ public class NewKeyboardLayoutEnabledLocalesFragment extends DashboardFragment
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ProfileSelectFragment.ProfileType.PERSONAL: {
|
case ProfileSelectFragment.ProfileType.PERSONAL: {
|
||||||
final UserHandle primaryUser = userManager.getPrimaryUser().getUserHandle();
|
// Use the parent user of the current user if the current user is profile.
|
||||||
newUserId = primaryUser.getIdentifier();
|
final UserHandle currentUser = UserHandle.of(currentUserId);
|
||||||
|
final UserHandle userProfileParent = userManager.getProfileParent(currentUser);
|
||||||
|
if (userProfileParent != null) {
|
||||||
|
newUserId = userProfileParent.getIdentifier();
|
||||||
|
} else {
|
||||||
|
newUserId = currentUserId;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user