Policy for AndroidThings

Adds a separate Policy implementation for AndroidThings, which is not
dependent on the ChromeOSPolicy implementation. It uses some new policy
implementation fragments (policy features) which were in ChromeOSPolicy.
ChromeOSPolicy will be separately refactored to use the policy
implementation fragments.

The AndroidThingsPolicy and ChromeOSPolicy classes (and dependencies)
are compiled in as needed, based on the platform.  Both classes and
dependencies are compiled into the unit test binary to ensure the proper
behavior of both.

Some unit tests are slightly duplicated across the Policy and policy
implementation fragments to confirm that the policy fragments are
consulted in the proper order/precedence.

Bug: 66016687
Test: Unit tests, manual OTA
Change-Id: I220e5720e0077309931eda70155523b3c0507567
(cherry picked from commit cd0d7bda708a44c2d839d0497e1791b42ed06e3d)
diff --git a/update_manager/update_manager.cc b/update_manager/update_manager.cc
index 8e9b221..25f3216 100644
--- a/update_manager/update_manager.cc
+++ b/update_manager/update_manager.cc
@@ -16,7 +16,11 @@
 
 #include "update_engine/update_manager/update_manager.h"
 
+#ifdef __ANDROID__
+#include "update_engine/update_manager/android_things_policy.h"
+#else
 #include "update_engine/update_manager/chromeos_policy.h"
+#endif  // __ANDROID__
 #include "update_engine/update_manager/state.h"
 
 namespace chromeos_update_manager {
@@ -28,9 +32,11 @@
         evaluation_timeout_(evaluation_timeout),
         expiration_timeout_(expiration_timeout),
         weak_ptr_factory_(this) {
-  // TODO(deymo): Make it possible to replace this policy with a different
-  // implementation with a build-time flag.
+#ifdef __ANDROID__
+  policy_.reset(new AndroidThingsPolicy());
+#else
   policy_.reset(new ChromeOSPolicy());
+#endif  // __ANDROID__
 }
 
 UpdateManager::~UpdateManager() {