Add assumptions to testRemoveUserWhenPossible_withProfiles.

This test method creates a user and adds profiles to it. Then after
removing the user it asserts that the profiles are also removed. But,
in case the profiles fail to be created, test was failing with a null
pointer exception. This CL adds necessary assumptions to make sure it
is possible to add profiles to the secondary user and skips otherwise
instead of failing.

Bug: 261468057
Test: atest com.android.server.pm.UserManagerTest#testRemoveUserWhenPossible_withProfiles
Change-Id: I3c31b8c66f596192f6ddd1a3b04dac34ac8fe681
1 file changed