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).

BUG=chromium:722799
TEST=unit tests added

Change-Id: Ifa8bc6bf616dc23eb767c97934fe4cdb77a3451a
Reviewed-on: https://chromium-review.googlesource.com/518045
Commit-Ready: Thiemo Nagel <tnagel@chromium.org>
Tested-by: Thiemo Nagel <tnagel@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
6 files changed