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

Commit 41704f98 authored by Presubmit Automerger Backend's avatar Presubmit Automerger Backend
Browse files

[automerge] Fix keyboard settings crash in multi-user case 2p: 237a06e0

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17539524

Bug: 216395439
Change-Id: Iac76ec56961b18816d750591654668b95d38e536
parents 11e9985b 237a06e0
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -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: {