Make disallow add/remove managed profile restriction not global.

Otherwise: if the DO sets remove managed profile user restriction:
the profile owner of a managed profile cannot remove this managed
profile.

BUG:33854430
Test: adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest -w
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I90b2028ea627a2073298bf9ef3c07b4fdf8d13a1
This commit is contained in:
Nicolas Prevot
2017-01-05 10:29:34 +00:00
parent d12655b851
commit 2ea46fe658
3 changed files with 10 additions and 11 deletions

View File

@@ -256,7 +256,7 @@ public class UserManager {
* Specifies if managed profiles of this user can be removed, other than by its profile owner.
* The default value is <code>false</code>.
* <p>
* This restriction can only be set by device owners.
* This restriction has no effect on managed profiles.
*
* <p>Key for user restrictions.
* <p>Type: Boolean
@@ -353,8 +353,8 @@ public class UserManager {
/**
* Specifies if a user is disallowed from adding managed profiles.
* <p>The default value for an unmanaged user is <code>false</code>.
* For users with a device owner set, the default is <code>true</code>
* <p>This restriction can only be set by device owners.
* For users with a device owner set, the default is <code>true</code>.
* <p>This restriction has no effect on managed profiles.
*
* <p>Key for user restrictions.
* <p>Type: Boolean