Remove unnecessary parent restriction check
When checking whether provisioning of a managed profile is allowed, it is unnecessary to check whether there's a restriction on the parent user because the check is done from the primary user. If the check is done from inside a managed profile, then the check should return false because a managed profile cannot be provisioned from within another managed profile. The DevicePolicyManagerTest was incorrectly returning user 0 as the "parent user" for user 0, so changed the test to return null as the profile parent for user 0. Bug: 147631026 Test: atest FrameworksServicesTests:DevicePolicyManagerTest Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.ManagedProfileTest#testIsProvisioningAllowed Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.DeviceOwnerTest#testIsManagedDeviceProvisioningAllowed Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.DeviceOwnerPlusProfileOwnerTest#testProvisioningNotAllowedWithDeviceOwner Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.CustomDeviceOwnerTest#testIsProvisioningAllowed Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.CustomManagedProfileTest#testIsProvisioningAllowed Change-Id: Ia62dce93265ec65b61a048c4d96f96baa4598a57
Loading
Please register or sign in to comment