login: Only enable managed adb sideloading if the policies allow it

Check the additional is_managed_adb_sideloading_allowed parameter when
enabling ADB sideloading for managed accounts and devices, whose value
is based on the corresponding device and user policies, as well as user

TEST=Verify that sideloading can be used outside of developer mode on managed devices and/or with managed user when the policies are set to allow it. The feature has to be enabled with --enable-features=ArcManagedAdbSideloadingSupport.
TEST=FEATURES=test emerge-$BOARD chromeos-base/chromeos-login

Change-Id: I0e460a0231dc74c27e498405dffdce9fbbc943c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2267098
Reviewed-by: Victor Hsieh <victorhsieh@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Commit-Queue: Jana Grill <janagrill@chromium.org>
Tested-by: Jana Grill <janagrill@chromium.org>
Auto-Submit: Jana Grill <janagrill@chromium.org>
Cr-Mirrored-From: https://chromium.googlesource.com/chromiumos/platform2
Cr-Mirrored-Commit: 21b4e3d2f5d17bc4d09173d3b4b1d1a756aaffdf
1 file changed
tree: 26041e0bec4fb8a0227494f954973ac17f5b6dcf
  1. .gitignore
  2. BUILD.gn
  3. Cargo.toml
  6. README.md
  7. build.rs
  8. constants/
  9. dbus/
  10. src/
  11. switches/
  12. system_api.pc

This directory (platform2/system_api) contains constants and definitions like D-Bus service names that are shared between Chromium and Chromium OS.

This directory is only for things like headers and .proto files. No implementation should be added.

When writting a .proto file make sure to use:

option optimize_for = LITE_RUNTIME;

This will force usage of a lite protobuf instead of a full/heavy weight protobuf. The browser only links against the light version, so you will get cryptic link errors about missing parts of Message if you define a protobuf here and then try to use it in Chrome. Currently CrOS links against the full protobuffer library, but that might change in the future.

When declaring a protobuf, avoid use of required unless it is exactly what you mean. “Required is Forever” and very rarely should actually be used. Consult Protocol Buffer Basics: C++ for a detailed of this issue.