Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

Replace enforce device owner in DPMS

* Replace enforceDeviceOwner and
  getActiveAdminForCallerLocked(DeviceAdminInfo.USES_POLICY_DEVICE_OWNER)
  with a precondition check.

Updated methods:
- setLogoutEnabled
- setStartUserSessionMessage
- setEndUserSessionMessage
- getStartUserSessionMessage
- getEndUserSessionMessage
- setDelegatedScopes
- setForceEphemeralUsers
- getForceEphemeralUsers
- requestBugreport
- switchUser
- setGlobalSetting
- setRecommendedGlobalProxy
- setDefaultSmsApplication
- removeUser
- startUserInBackground
- stopUser
- getSecondaryUsers
- isSystemOnlyUser
- reboot
- addOverrideApn
- updateOverrideApn
- removeOverrideApn
- getOverrideApns
- setOverrideApnsEnabled
- isOverrideApnEnabled
- setGlobalPrivateDns
- getGlobalPrivateDnsMode
- getGlobalPrivateDnsHost
- setUserControlDisabledPackages

Bug: 163473986
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testUserSession
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegation
      atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testDelegation
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegatedCertInstaller
      atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testDelegatedCertInstaller
      atest com.android.cts.devicepolicy.DeviceOwnerPlusProfileOwnerTest#testRequestBugreportAvailableIfAffiliated
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testRemoteBugreportWithTwoUsers
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testAdminActionBookkeeping
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_SwitchUser
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_CannotStopCurrentUser
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_StartInBackground
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_StartInBackground_MaxRunningUsers
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_StopUser
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_StopEphemeralUser_DisallowRemoveUser
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_SkipSetupWizard
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_LogoutUser
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_Affiliated
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_Ephemeral
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_LeaveAllSystemApps
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testSetGlobalSettingLogged
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testSetTime
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testProxyStaticProxyTest
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testProxyPacProxyTest
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testDefaultSmsApplication
      atest com.android.cts.devicepolicy.ManagedProfileTest#testCannotCallMethodsOnParentProfile
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_RemoveRestrictionSet
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testUserAddedOrRemovedBroadcasts
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_GetSecondaryUsers
      atest com.android.cts.devicepolicy.DeviceAndProfileOwnerHostSideTransferTest#testTransferCompleteCallback
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testOverrideApn
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testSetUserControlDisabledPackages
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testWifiConfigLockdown
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testPrivateDnsPolicy
Change-Id: If3f761e8826a77aa1a4d476fad087f554094d6fd
parent ae5e7178
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