Skip to content
Commit 51419384 authored by Alex Johnston's avatar Alex Johnston
Browse files

Update user restriction APIs to be called on parent instance

In the new COPE mode, some user restrictions should be applied globally
when called by the Work Profile PO.

Previously, the APIs addUserRestriction, clearUserRestriction and
getUserRestrictions did not support explicitly querying the parent
profile. This CL allows the WP DPC to now call these methods,
allowing the WP DPC to apply some restrictions globally.

This CL also introduces the enforcingUserId parameter to
setDevicePolicyUserRestriction. This new paramter is used as the
key of mDevicePolicyGlobalUserRestrictions and
mDevicePolicyLocalUserRestrictions.

Bug: 138709470
Test: Manual testing with testdpc
      atest com.android.server.devicepolicy.DevicePolicyManagerTest
      atest com.android.cts.devicepolicy.UserRestrictionsTest
      atest com.android.server.pm.UserRestrictionsUtilsTest
      atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testUserRestrictionsSetOnParentAreNotPersisted
      atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testDevicePolicyManagerParentSupport

Change-Id: Idfafd100bfcb250998a8628aba4cc378f1fc2c84
parent f707567c
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