Device policy resolution framework

Starting with Android 14, multiple device policy management agents can set policies using DevicePolicyManager APIs.

General principles

In cases where more than one device policy management agent enforces policies over a user:

Android 14 (API level 34) and higher

In Android 14 (API level 34) and higher, Android-compatible devices must implement the policy resolution mechanism as defined in the following table to resolve conflicts when a policy is set by more than one device policy management agent. The resolution mechanisms referenced in the following table (MostRecent, MostRestrictive, StringSetUnion, and TopPriority) are class names of the resolution mechanisms defined in the Android Open Source Project.

Policies identified by PolicyIdentifier instances document their resolution strategy individually in their API reference documentation.

DevicePolicyManager API Resolution mechanism setPermittedInputMethods getPermittedInputMethods MostRecent: The most-recent policy is enforced when set by multiple admins. setUninstallBlocked isUninstallBlocked setCameraDisabled getCameraDisabled setApplicationHidden isApplicationHidden setAccountManagementDisabled getAccountTypesWithManagementDisabled setAutoTimeRequired addUserRestriction addUserRestrictionGlobally clearUserRestriction getUserRestrictions setScreenCaptureDisabled getScreenCaptureDisabled MostRestrictive: Sets the user restriction if any admin has set it. setUserControlDisabledPackages getUserControlDisabledPackages StringSetUnion: Resolves as the union of policies set by one or more admins (for policies represented as a Set of Strings). setLockTaskFeatures getLockTaskFeatures getLockTaskPackages setLockTaskPackages addPersistentPreferredActivity clearPackagePersistentPreferredActivities TopPriority: Resolves with the following most-to-least priority order defined by the role held by the device policy management agent:
  1. The device lock admin
  2. The enterprise admin
  3. Any other admin