Skip to content
Commit 957d31d1 authored by Eran Messeri's avatar Eran Messeri
Browse files

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
parent 6ef8f5e1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment