Puts mPm.onNewUserCreated inside Binder.withCleanCallingIdentity
PackageManagerService.onNewUserCreated eventually calls ComputerEngine.getInstalledPackages. And it requires callingUid to have INTERACT_ACROSS_USERS permission. That was failing some tests for auto. This CL makes sure that method is called with clean calling identity. Bug: 228253821 Test: atest CtsMultiUserTestCases:android.multiuser.cts.UserManagerTest#testCreateUser_withNewUserRequest_shouldCreateUserWithCorrectProperties Change-Id: Ia06b9d5e6501140541e8d520350368df1abe2f15
This commit is contained in:
@@ -4207,7 +4207,9 @@ public class UserManagerService extends IUserManager.Stub {
|
||||
writeUserListLP();
|
||||
}
|
||||
updateUserIds();
|
||||
mPm.onNewUserCreated(preCreatedUser.id, /* convertedFromPreCreated= */ true);
|
||||
Binder.withCleanCallingIdentity(() -> {
|
||||
mPm.onNewUserCreated(preCreatedUser.id, /* convertedFromPreCreated= */ true);
|
||||
});
|
||||
dispatchUserAdded(preCreatedUser, token);
|
||||
return preCreatedUser;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user