libbrillo: Add DevicePolicy::IsEnterpriseManaged()

Use management_mode to determine whether device is managed and only
fall back to DM token in case the former doesn't exist.  This is
required to properly support Chromad, but should have no effect on
other types of management (including local ownership).

TEST=unit tests added

Change-Id: Ifa8bc6bf616dc23eb767c97934fe4cdb77a3451a
Commit-Ready: Thiemo Nagel <>
Tested-by: Thiemo Nagel <>
Reviewed-by: Dan Erat <>
6 files changed