Various createUsers don't sometimes return null
Previously, UserManagerService.createUserInternalUncheckedNoTracing would usually throw on failure, but could instead return null in certain circumstances (namely, bad input). This lead to ambiguity over whether the various createUser methods were able to return null. Here, we throw instead in these previously-null situations. This way, all of the createUser methods are @NonNull, unless they specifically catch errors and return null instead. The methods are now all self-consistent. In particular, this fixes the previously not-always-correct annotation of @NonNull that is on UserManager.preCreateUser. Bug: 219942927 Test: atest com.android.server.pm.UserManagerTest Test: atest com.android.server.pm.UserManagerServiceTest Test: atest android.multiuser.cts.UserManagerTest Change-Id: I7a63b4e684d03b4d2ef76046d0cf277ba2d5744d
Loading
Please register or sign in to comment