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

Commit cc7f845f authored by Felipe Leme's avatar Felipe Leme
Browse files

Refactored Settings calls to removeUserOrSetEphemeral().

Test: atest com.android.car.user.CarUserServiceTest \
      android.car.apitest.CarDevicePolicyManagerTest#testRemoveUser_whenDisallowed
Bug: 170887769

Change-Id: If797ace64c0fa0262116f649212bbcb1d61e2046
parent aaf2ad77
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -751,7 +751,8 @@ public class UserSettings extends SettingsPreferenceFragment
        }
        try {
            getContext().getSystemService(UserManager.class)
                    .removeUserOrSetEphemeral(UserHandle.myUserId());
                    .removeUserOrSetEphemeral(UserHandle.myUserId(),
                            /* evenWhenDisallowed= */ false);
            ActivityManager.getService().switchUser(UserHandle.USER_SYSTEM);
        } catch (RemoteException re) {
            Log.e(TAG, "Unable to remove self user");