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

Commit 8031c0bb authored by Felipe Leme's avatar Felipe Leme
Browse files

Use UserManager.removeUserOrSetEphemeral() to remove current user.

Test: manual verification
Bug: 173245580
Bug: 155913815

Change-Id: I74ac8d276f3a78f6c9483a980e4a05486b0c1a8c
parent 3f74b1f5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -747,8 +747,9 @@ public class UserSettings extends SettingsPreferenceFragment
            return;
        }
        try {
            getContext().getSystemService(UserManager.class)
                    .removeUserOrSetEphemeral(UserHandle.myUserId());
            ActivityManager.getService().switchUser(UserHandle.USER_SYSTEM);
            getContext().getSystemService(UserManager.class).removeUser(UserHandle.myUserId());
        } catch (RemoteException re) {
            Log.e(TAG, "Unable to remove self user");
        }