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

Commit edb6a012 authored by Alex Chau's avatar Alex Chau
Browse files

LogoutAction should store current user id before swithcing

- Without this currentUserId will change and SysUI crash when trying to stop system user

Bug: 71889217
Test: No crash when using logout button, and user is stopped
Change-Id: Ifeb083fd61f5cccf7dba4e3e3c2618762f6233b8
parent c4533b70
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -587,9 +587,9 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener,
            // switching user
            mHandler.postDelayed(() -> {
                try {
                    int currentUserId = getCurrentUser().id;
                    ActivityManager.getService().switchUser(UserHandle.USER_SYSTEM);
                    ActivityManager.getService().stopUser(getCurrentUser().id, true /*force*/,
                            null);
                    ActivityManager.getService().stopUser(currentUserId, true /*force*/, null);
                } catch (RemoteException re) {
                    Log.e(TAG, "Couldn't logout user " + re);
                }