Merge changes from topic "presubmit-am-69008cfea6c94780a0c9a9e956ead727" into tm-mainline-prod
* changes:
[automerge] Fix keyboard settings crash in multi-user case 2p: 237a06e0c1
Fix keyboard settings crash in multi-user case
This commit is contained in:
committed by
Android (Google) Code Review
commit
485bfa10b7
@@ -74,15 +74,11 @@ public class AvailableVirtualKeyboardFragment extends DashboardFragment
|
||||
final Context newUserAwareContext;
|
||||
switch (profileType) {
|
||||
case ProfileSelectFragment.ProfileType.WORK: {
|
||||
final UserHandle workUser;
|
||||
if (currentUserId == UserHandle.MIN_SECONDARY_USER_ID) {
|
||||
newUserId = currentUserId;
|
||||
workUser = UserHandle.of(currentUserId);
|
||||
} else {
|
||||
newUserId = Utils.getManagedProfileId(userManager, currentUserId);
|
||||
workUser = Utils.getManagedProfile(userManager);
|
||||
}
|
||||
newUserAwareContext = context.createContextAsUser(workUser, 0);
|
||||
// If the user is a managed profile user, use currentUserId directly. Or get the
|
||||
// managed profile userId instead.
|
||||
newUserId = userManager.isManagedProfile()
|
||||
? currentUserId : Utils.getManagedProfileId(userManager, currentUserId);
|
||||
newUserAwareContext = context.createContextAsUser(UserHandle.of(newUserId), 0);
|
||||
break;
|
||||
}
|
||||
case ProfileSelectFragment.ProfileType.PERSONAL: {
|
||||
|
Reference in New Issue
Block a user