Manish Singh
2023-09-28 12:02:21 +01:00
parent a223c7644e
commit 6efc455f2c
32 changed files with 954 additions and 162 deletions

View File

@@ -84,6 +84,16 @@ public class AvailableVirtualKeyboardFragment extends DashboardFragment
newUserAwareContext = context.createContextAsUser(UserHandle.of(newUserId), 0);
break;
}
case ProfileSelectFragment.ProfileType.PRIVATE: {
// If the user is a private profile user, use currentUserId directly. Or get the
// private profile userId instead.
newUserId = userManager.isPrivateProfile()
? currentUserId
: Utils.getCurrentUserIdOfType(
userManager, ProfileSelectFragment.ProfileType.PRIVATE);
newUserAwareContext = context.createContextAsUser(UserHandle.of(newUserId), 0);
break;
}
case ProfileSelectFragment.ProfileType.PERSONAL: {
// Use the parent user of the current user if the current user is profile.
final UserHandle currentUser = UserHandle.of(currentUserId);

View File

@@ -77,6 +77,15 @@ public class NewKeyboardLayoutEnabledLocalesFragment extends DashboardFragment
? currentUserId : Utils.getManagedProfileId(userManager, currentUserId);
break;
}
case ProfileSelectFragment.ProfileType.PRIVATE: {
// If the user is a private profile user, use currentUserId directly. Or get the
// private profile userId instead.
newUserId = userManager.isPrivateProfile()
? currentUserId
: Utils.getCurrentUserIdOfType(
userManager, ProfileSelectFragment.ProfileType.PRIVATE);
break;
}
case ProfileSelectFragment.ProfileType.PERSONAL: {
final UserHandle primaryUser = userManager.getPrimaryUser().getUserHandle();
newUserId = primaryUser.getIdentifier();