Skip to content
Commit a47d72c3 authored by Sarup Dalwani's avatar Sarup Dalwani
Browse files

Restricting creation of Clone Profile when the device owner is set

As part of Android S, the restriction was enforced by CDD but the user creation flow did not
block creation of clone profile. Creating changes that will add user restriction
of type  UserManager.DISALLOW_ADD_CLONE_PROFILE while setting up device
owner. This restriction is checked while user creation flow and throws
UserManager.CheckedUserOperationException. When the device owner is
removed, the user restriction UserManager.DISALLOW_ADD_CLONE_PROFILE is
removed and creation of clone profile is allowed.

Bug: 211862605
Test: 1. atest FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest
2. atest FrameworksServicesTests:com.android.server.pm.UserManagerTest
3. Manually tried creation of clone profile before setting device
owner, able to create clone profile
4. Manually set device owner and tried to create clone profile, unable to
create clone profile
5. Manually removed device owner and tried to create clone profile, able
to create clone profile.

Change-Id: Id87756601a25323e06036a3193f6a7f8f53fa71d
parent b9003c2a
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