Merge "update_engine: Update libchrome APIS to r456626."
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..c3d164b
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,8 @@
+// AIDL interface between libupdate_engine and framework.jar
+filegroup {
+    name: "libupdate_engine_aidl",
+    srcs: [
+        "binder_bindings/android/os/IUpdateEngine.aidl",
+        "binder_bindings/android/os/IUpdateEngineCallback.aidl",
+    ],
+}
diff --git a/client_library/include/update_engine/update_status.h b/client_library/include/update_engine/update_status.h
index d93ca91..41fab48 100644
--- a/client_library/include/update_engine/update_status.h
+++ b/client_library/include/update_engine/update_status.h
@@ -19,6 +19,8 @@
 
 #include <string>
 
+#include <brillo/enum_flags.h>
+
 namespace update_engine {
 
 enum class UpdateStatus {
@@ -44,25 +46,13 @@
   kFlagRestrictDownload = (1 << 1),
 };
 
-// These bit-wise operators for the above flags allow for standard bit-wise
-// operations to return values in an expected manner, with the need to
-// continually cast the results back to UpdateAttemptFlags after the implicit
-// conversion to int from enum to perform the bitwise comparison using the
-// underlying type.
-inline UpdateAttemptFlags operator|(const UpdateAttemptFlags& l,
-                                    const UpdateAttemptFlags& r) {
-  return static_cast<UpdateAttemptFlags>(static_cast<const int32_t&>(l) |
-                                         static_cast<const int32_t&>(r));
-}
-inline UpdateAttemptFlags operator&(const UpdateAttemptFlags& l,
-                                    const UpdateAttemptFlags& r) {
-  return static_cast<UpdateAttemptFlags>(static_cast<const int32_t&>(l) &
-                                         static_cast<const int32_t&>(r));
-}
+// Enable bit-wise operators for the above enumeration of flag values.
+DECLARE_FLAGS_ENUM(UpdateAttemptFlags);
 
 struct UpdateEngineStatus {
-  // When the update_engine last checked for updates (ms since Epoch)
-  int64_t last_checked_time_ms;
+  // When the update_engine last checked for updates (time_t: seconds from unix
+  // epoch)
+  int64_t last_checked_time;
   // the current status/operation of the update_engine
   UpdateStatus status;
   // the current product version (oem bundle id)
diff --git a/omaha_response_handler_action_unittest.cc b/omaha_response_handler_action_unittest.cc
index de508ec..568d11d 100644
--- a/omaha_response_handler_action_unittest.cc
+++ b/omaha_response_handler_action_unittest.cc
@@ -16,6 +16,7 @@
 
 #include "update_engine/omaha_response_handler_action.h"
 
+#include <memory>
 #include <string>
 
 #include <base/files/file_util.h>
@@ -38,10 +39,10 @@
 using chromeos_update_manager::FakeUpdateManager;
 using chromeos_update_manager::MockPolicy;
 using std::string;
+using testing::_;
 using testing::DoAll;
 using testing::Return;
 using testing::SetArgPointee;
-using testing::_;
 
 namespace chromeos_update_engine {
 
@@ -81,8 +82,7 @@
     : public ActionProcessorDelegate {
  public:
   OmahaResponseHandlerActionProcessorDelegate()
-      : code_(ErrorCode::kError),
-        code_set_(false) {}
+      : code_(ErrorCode::kError), code_set_(false) {}
   void ActionCompleted(ActionProcessor* processor,
                        AbstractAction* action,
                        ErrorCode code) {
@@ -109,10 +109,9 @@
 const char* const kPayloadHashHex = "486173682b";
 }  // namespace
 
-bool OmahaResponseHandlerActionTest::DoTest(
-    const OmahaResponse& in,
-    const string& test_deadline_file,
-    InstallPlan* out) {
+bool OmahaResponseHandlerActionTest::DoTest(const OmahaResponse& in,
+                                            const string& test_deadline_file,
+                                            InstallPlan* out) {
   brillo::FakeMessageLoop loop(nullptr);
   loop.SetAsCurrent();
   ActionProcessor processor;
@@ -161,9 +160,9 @@
 
 TEST_F(OmahaResponseHandlerActionTest, SimpleTest) {
   string test_deadline_file;
-  CHECK(utils::MakeTempFile(
-          "omaha_response_handler_action_unittest-XXXXXX",
-          &test_deadline_file, nullptr));
+  CHECK(utils::MakeTempFile("omaha_response_handler_action_unittest-XXXXXX",
+                            &test_deadline_file,
+                            nullptr));
   ScopedPathUnlinker deadline_unlinker(test_deadline_file);
   {
     OmahaResponse in;
@@ -464,7 +463,8 @@
   EXPECT_CALL(*fake_system_state_.mock_payload_state(), GetP2PUrl())
       .WillRepeatedly(Return(p2p_url));
   EXPECT_CALL(*fake_system_state_.mock_payload_state(),
-              GetUsingP2PForDownloading()).WillRepeatedly(Return(true));
+              GetUsingP2PForDownloading())
+      .WillRepeatedly(Return(true));
 
   InstallPlan install_plan;
   EXPECT_TRUE(DoTest(in, "", &install_plan));
diff --git a/parcelable_update_engine_status.cc b/parcelable_update_engine_status.cc
index d3e7eaa..8a2dbeb 100644
--- a/parcelable_update_engine_status.cc
+++ b/parcelable_update_engine_status.cc
@@ -26,7 +26,7 @@
 
 ParcelableUpdateEngineStatus::ParcelableUpdateEngineStatus(
     const UpdateEngineStatus& status)
-    : last_checked_time_(status.last_checked_time_ms),
+    : last_checked_time_(status.last_checked_time),
       current_operation_(
           chromeos_update_engine::UpdateStatusToString(status.status)),
       progress_(status.progress),
diff --git a/parcelable_update_engine_status.h b/parcelable_update_engine_status.h
index 2050622..82006e4 100644
--- a/parcelable_update_engine_status.h
+++ b/parcelable_update_engine_status.h
@@ -39,7 +39,7 @@
 
   // This list is kept in the Parcelable serialization order.
 
-  // When the update_engine last checked for updates (ms since Epoch)
+  // When the update_engine last checked for updates (seconds since unix Epoch)
   int64_t last_checked_time_;
   // The current status/operation of the update_engine.
   android::String16 current_operation_;
diff --git a/parcelable_update_engine_status_unittest.cc b/parcelable_update_engine_status_unittest.cc
index 3e6f7eb..f4bd518 100644
--- a/parcelable_update_engine_status_unittest.cc
+++ b/parcelable_update_engine_status_unittest.cc
@@ -40,8 +40,7 @@
                                   "2.3.4.5",
                                   "3.4.5.6"};
   ParcelableUpdateEngineStatus parcelable_status(ue_status);
-  EXPECT_EQ(ue_status.last_checked_time_ms,
-            parcelable_status.last_checked_time_);
+  EXPECT_EQ(ue_status.last_checked_time, parcelable_status.last_checked_time_);
   EXPECT_EQ(
       String16{chromeos_update_engine::UpdateStatusToString(ue_status.status)},
       parcelable_status.current_operation_);
diff --git a/update_attempter.cc b/update_attempter.cc
index 2ca51ee..d955c7f 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -1169,7 +1169,7 @@
 }
 
 bool UpdateAttempter::GetStatus(UpdateEngineStatus* out_status) {
-  out_status->last_checked_time_ms = last_checked_time_;
+  out_status->last_checked_time = last_checked_time_;
   out_status->status = status_;
   out_status->current_version = omaha_request_params_->app_version();
   out_status->current_system_version = omaha_request_params_->system_version();
diff --git a/update_attempter_unittest.cc b/update_attempter_unittest.cc
index b612811..ff7700e 100644
--- a/update_attempter_unittest.cc
+++ b/update_attempter_unittest.cc
@@ -68,7 +68,7 @@
 #if USE_LIBCROS
 using org::chromium::LibCrosServiceInterfaceProxyMock;
 using org::chromium::UpdateEngineLibcrosProxyResolvedInterfaceProxyMock;
-#endif // USE_LIBCROS
+#endif  // USE_LIBCROS
 using std::string;
 using std::unique_ptr;
 using testing::_;
diff --git a/update_manager/android_things_policy.cc b/update_manager/android_things_policy.cc
index 3af93cc..5fbda46 100644
--- a/update_manager/android_things_policy.cc
+++ b/update_manager/android_things_policy.cc
@@ -110,7 +110,6 @@
   ApiRestrictedDownloadsPolicyImpl api_restricted_downloads_policy;
 
   vector<Policy const*> policies_to_consult = {
-
       // Do not apply the update if all updates are restricted by the API.
       &api_restricted_downloads_policy,
   };
diff --git a/update_manager/android_things_policy.h b/update_manager/android_things_policy.h
index b45e955..9fd8bc4 100644
--- a/update_manager/android_things_policy.h
+++ b/update_manager/android_things_policy.h
@@ -61,18 +61,18 @@
 
   // P2P is always disabled.  Returns |result|==|false| and
   // |EvalStatus::kSucceeded|
-  virtual EvalStatus P2PEnabled(EvaluationContext* ec,
-                                State* state,
-                                std::string* error,
-                                bool* result) const override;
+  EvalStatus P2PEnabled(EvaluationContext* ec,
+                        State* state,
+                        std::string* error,
+                        bool* result) const override;
 
   // This will return immediately with |EvalStatus::kSucceeded| and set
   // |result|==|false|
-  virtual EvalStatus P2PEnabledChanged(EvaluationContext* ec,
-                                       State* state,
-                                       std::string* error,
-                                       bool* result,
-                                       bool prev_result) const override;
+  EvalStatus P2PEnabledChanged(EvaluationContext* ec,
+                               State* state,
+                               std::string* error,
+                               bool* result,
+                               bool prev_result) const override;
 
  protected:
   // Policy override.
diff --git a/update_manager/android_things_policy_unittest.cc b/update_manager/android_things_policy_unittest.cc
index 04b0e0e..8a50bc2 100644
--- a/update_manager/android_things_policy_unittest.cc
+++ b/update_manager/android_things_policy_unittest.cc
@@ -16,6 +16,8 @@
 
 #include "update_engine/update_manager/android_things_policy.h"
 
+#include <memory>
+
 #include "update_engine/update_manager/next_update_check_policy_impl.h"
 #include "update_engine/update_manager/policy_test_utils.h"
 
@@ -38,6 +40,7 @@
     // For the purpose of the tests, this is an official build
     fake_state_.system_provider()->var_is_official_build()->reset(
         new bool(true));
+    // NOLINTNEXTLINE(readability/casting)
     fake_state_.system_provider()->var_num_slots()->reset(new unsigned int(2));
   }
 
@@ -115,6 +118,7 @@
   // UpdateCheckAllowed should return false (kSucceeded) if the image booted
   // without enough slots to do A/B updates.
 
+  // NOLINTNEXTLINE(readability/casting)
   fake_state_.system_provider()->var_num_slots()->reset(new unsigned int(1));
 
   UpdateCheckParams result;
diff --git a/update_manager/api_restricted_downloads_policy_impl.h b/update_manager/api_restricted_downloads_policy_impl.h
index 69686d6..21457a5 100644
--- a/update_manager/api_restricted_downloads_policy_impl.h
+++ b/update_manager/api_restricted_downloads_policy_impl.h
@@ -48,4 +48,4 @@
 
 }  // namespace chromeos_update_manager
 
-#endif  // UPDATE_ENGINE_UPDATE_MANAGER_API_RESTRICTED_DOWNLOADS_POLICY_IMPL_H_
\ No newline at end of file
+#endif  // UPDATE_ENGINE_UPDATE_MANAGER_API_RESTRICTED_DOWNLOADS_POLICY_IMPL_H_
diff --git a/update_manager/boxed_value_unittest.cc b/update_manager/boxed_value_unittest.cc
index 83d8de7..4aeaec8 100644
--- a/update_manager/boxed_value_unittest.cc
+++ b/update_manager/boxed_value_unittest.cc
@@ -21,6 +21,7 @@
 #include <map>
 #include <set>
 #include <string>
+#include <utility>
 
 #include <base/strings/stringprintf.h>
 #include <base/time/time.h>
diff --git a/update_manager/chromeos_policy_unittest.cc b/update_manager/chromeos_policy_unittest.cc
index 2cd2aa6..63fa0f7 100644
--- a/update_manager/chromeos_policy_unittest.cc
+++ b/update_manager/chromeos_policy_unittest.cc
@@ -93,6 +93,7 @@
         new bool(true));
     fake_state_.system_provider()->var_is_oobe_complete()->reset(
         new bool(true));
+    // NOLINTNEXTLINE(readability/casting)
     fake_state_.system_provider()->var_num_slots()->reset(new unsigned int(2));
 
     // Connection is wifi, untethered.
@@ -422,6 +423,7 @@
   // UpdateCheckAllowed should return false (kSucceeded) if the image booted
   // without enough slots to do A/B updates.
 
+  // NOLINTNEXTLINE(readability/casting)
   fake_state_.system_provider()->var_num_slots()->reset(new unsigned int(1));
 
   UpdateCheckParams result;
diff --git a/update_manager/enough_slots_ab_updates_policy_impl.h b/update_manager/enough_slots_ab_updates_policy_impl.h
index c0701f8..1d45389 100644
--- a/update_manager/enough_slots_ab_updates_policy_impl.h
+++ b/update_manager/enough_slots_ab_updates_policy_impl.h
@@ -46,4 +46,4 @@
 
 }  // namespace chromeos_update_manager
 
-#endif  // UPDATE_ENGINE_UPDATE_MANAGER_ENOUGH_SLOTS_AB_UPDATES_POLICY_IMPL_H_
\ No newline at end of file
+#endif  // UPDATE_ENGINE_UPDATE_MANAGER_ENOUGH_SLOTS_AB_UPDATES_POLICY_IMPL_H_
diff --git a/update_manager/fake_updater_provider.h b/update_manager/fake_updater_provider.h
index 3e03d43..7295765 100644
--- a/update_manager/fake_updater_provider.h
+++ b/update_manager/fake_updater_provider.h
@@ -41,13 +41,9 @@
     return &var_update_completed_time_;
   }
 
-  FakeVariable<double>* var_progress() override {
-    return &var_progress_;
-  }
+  FakeVariable<double>* var_progress() override { return &var_progress_; }
 
-  FakeVariable<Stage>* var_stage() override {
-    return &var_stage_;
-  }
+  FakeVariable<Stage>* var_stage() override { return &var_stage_; }
 
   FakeVariable<std::string>* var_new_version() override {
     return &var_new_version_;
@@ -65,9 +61,7 @@
     return &var_new_channel_;
   }
 
-  FakeVariable<bool>* var_p2p_enabled() override {
-    return &var_p2p_enabled_;
-  }
+  FakeVariable<bool>* var_p2p_enabled() override { return &var_p2p_enabled_; }
 
   FakeVariable<bool>* var_cellular_enabled() override {
     return &var_cellular_enabled_;
@@ -90,45 +84,30 @@
   }
 
  private:
-  FakeVariable<base::Time>
-      var_updater_started_time_{  // NOLINT(whitespace/braces)
-    "updater_started_time", kVariableModePoll};
-  FakeVariable<base::Time> var_last_checked_time_{  // NOLINT(whitespace/braces)
-    "last_checked_time", kVariableModePoll};
-  FakeVariable<base::Time>
-      var_update_completed_time_{  // NOLINT(whitespace/braces)
-    "update_completed_time", kVariableModePoll};
-  FakeVariable<double> var_progress_{  // NOLINT(whitespace/braces)
-    "progress", kVariableModePoll};
-  FakeVariable<Stage> var_stage_{  // NOLINT(whitespace/braces)
-    "stage", kVariableModePoll};
-  FakeVariable<std::string> var_new_version_{  // NOLINT(whitespace/braces)
-    "new_version", kVariableModePoll};
-  FakeVariable<uint64_t> var_payload_size_{// NOLINT(whitespace/braces)
-    "payload_size", kVariableModePoll};
-  FakeVariable<std::string> var_curr_channel_{  // NOLINT(whitespace/braces)
-    "curr_channel", kVariableModePoll};
-  FakeVariable<std::string> var_new_channel_{  // NOLINT(whitespace/braces)
-    "new_channel", kVariableModePoll};
-  FakeVariable<bool> var_p2p_enabled_{// NOLINT(whitespace/braces)
-                                      "p2p_enabled",
-                                      kVariableModeAsync};
-  FakeVariable<bool> var_cellular_enabled_{// NOLINT(whitespace/braces)
-                                           "cellular_enabled",
+  FakeVariable<base::Time> var_updater_started_time_{"updater_started_time",
+                                                     kVariableModePoll};
+  FakeVariable<base::Time> var_last_checked_time_{"last_checked_time",
+                                                  kVariableModePoll};
+  FakeVariable<base::Time> var_update_completed_time_{"update_completed_time",
+                                                      kVariableModePoll};
+  FakeVariable<double> var_progress_{"progress", kVariableModePoll};
+  FakeVariable<Stage> var_stage_{"stage", kVariableModePoll};
+  FakeVariable<std::string> var_new_version_{"new_version", kVariableModePoll};
+  FakeVariable<uint64_t> var_payload_size_{"payload_size", kVariableModePoll};
+  FakeVariable<std::string> var_curr_channel_{"curr_channel",
+                                              kVariableModePoll};
+  FakeVariable<std::string> var_new_channel_{"new_channel", kVariableModePoll};
+  FakeVariable<bool> var_p2p_enabled_{"p2p_enabled", kVariableModeAsync};
+  FakeVariable<bool> var_cellular_enabled_{"cellular_enabled",
                                            kVariableModeAsync};
-  FakeVariable<unsigned int>
-      var_consecutive_failed_update_checks_{  // NOLINT(whitespace/braces)
-    "consecutive_failed_update_checks", kVariableModePoll};
-  FakeVariable<unsigned int>
-      var_server_dictated_poll_interval_{  // NOLINT(whitespace/braces)
-    "server_dictated_poll_interval", kVariableModePoll};
-  FakeVariable<UpdateRequestStatus>
-      var_forced_update_requested_{  // NOLINT(whitespace/braces)
-    "forced_update_requested", kVariableModeAsync};
+  FakeVariable<unsigned int> var_consecutive_failed_update_checks_{
+      "consecutive_failed_update_checks", kVariableModePoll};
+  FakeVariable<unsigned int> var_server_dictated_poll_interval_{
+      "server_dictated_poll_interval", kVariableModePoll};
+  FakeVariable<UpdateRequestStatus> var_forced_update_requested_{
+      "forced_update_requested", kVariableModeAsync};
   FakeVariable<UpdateRestrictions> var_update_restrictions_{
-      // NOLINT(whitespace/braces)
-      "update_restrictions",
-      kVariableModePoll};
+      "update_restrictions", kVariableModePoll};
 
   DISALLOW_COPY_AND_ASSIGN(FakeUpdaterProvider);
 };
diff --git a/update_manager/interactive_update_policy_impl.h b/update_manager/interactive_update_policy_impl.h
index fc68ea3..a431456 100644
--- a/update_manager/interactive_update_policy_impl.h
+++ b/update_manager/interactive_update_policy_impl.h
@@ -46,4 +46,4 @@
 
 }  // namespace chromeos_update_manager
 
-#endif  // UPDATE_ENGINE_UPDATE_MANAGER_OFFICIAL_BUILD_CHECK_POLICY_IMPL_H_
\ No newline at end of file
+#endif  // UPDATE_ENGINE_UPDATE_MANAGER_OFFICIAL_BUILD_CHECK_POLICY_IMPL_H_
diff --git a/update_manager/next_update_check_policy_impl.h b/update_manager/next_update_check_policy_impl.h
index d9f3c3b..291ea0f 100644
--- a/update_manager/next_update_check_policy_impl.h
+++ b/update_manager/next_update_check_policy_impl.h
@@ -95,4 +95,4 @@
 
 }  // namespace chromeos_update_manager
 
-#endif  // UPDATE_ENGINE_UPDATE_MANAGER_NEXT_UPDATE_CHECK_POLICY_IMPL_H_
\ No newline at end of file
+#endif  // UPDATE_ENGINE_UPDATE_MANAGER_NEXT_UPDATE_CHECK_POLICY_IMPL_H_
diff --git a/update_manager/next_update_check_policy_impl_unittest.cc b/update_manager/next_update_check_policy_impl_unittest.cc
index ddc88e7..58aff66 100644
--- a/update_manager/next_update_check_policy_impl_unittest.cc
+++ b/update_manager/next_update_check_policy_impl_unittest.cc
@@ -16,6 +16,8 @@
 
 #include "update_engine/update_manager/next_update_check_policy_impl.h"
 
+#include <memory>
+
 #include "update_engine/update_manager/policy_test_utils.h"
 
 using base::Time;
@@ -92,7 +94,7 @@
   Time next_update_check;
 
   fake_state_.updater_provider()->var_consecutive_failed_update_checks()->reset(
-      new unsigned int(2));
+      new unsigned int{2});
 
   ExpectStatus(EvalStatus::kSucceeded,
                NextUpdateCheckTimePolicyImpl::NextUpdateCheckTime,
@@ -117,10 +119,10 @@
 
   const auto kInterval = policy_test_constants.timeout_periodic_interval * 4;
   fake_state_.updater_provider()->var_server_dictated_poll_interval()->reset(
-      new unsigned int(kInterval));
+      new unsigned int(kInterval));  // NOLINT(readability/casting)
   // We should not be backing off in this case.
   fake_state_.updater_provider()->var_consecutive_failed_update_checks()->reset(
-      new unsigned int(2));
+      new unsigned int(2));  // NOLINT(readability/casting)
 
   ExpectStatus(EvalStatus::kSucceeded,
                &NextUpdateCheckTimePolicyImpl::NextUpdateCheckTime,
@@ -139,7 +141,7 @@
   Time next_update_check;
 
   fake_state_.updater_provider()->var_consecutive_failed_update_checks()->reset(
-      new unsigned int(100));
+      new unsigned int(100));  // NOLINT(readability/casting)
 
   ExpectStatus(EvalStatus::kSucceeded,
                &NextUpdateCheckTimePolicyImpl::NextUpdateCheckTime,
@@ -158,4 +160,4 @@
             next_update_check);
 }
 
-}  // namespace chromeos_update_manager
\ No newline at end of file
+}  // namespace chromeos_update_manager
diff --git a/update_manager/official_build_check_policy_impl.h b/update_manager/official_build_check_policy_impl.h
index deb81c3..6257209 100644
--- a/update_manager/official_build_check_policy_impl.h
+++ b/update_manager/official_build_check_policy_impl.h
@@ -46,4 +46,4 @@
 
 }  // namespace chromeos_update_manager
 
-#endif  // UPDATE_ENGINE_UPDATE_MANAGER_OFFICIAL_BUILD_CHECK_POLICY_IMPL_H_
\ No newline at end of file
+#endif  // UPDATE_ENGINE_UPDATE_MANAGER_OFFICIAL_BUILD_CHECK_POLICY_IMPL_H_
diff --git a/update_manager/policy_test_utils.cc b/update_manager/policy_test_utils.cc
index dfeb2d4..fbfcb82 100644
--- a/update_manager/policy_test_utils.cc
+++ b/update_manager/policy_test_utils.cc
@@ -16,6 +16,7 @@
 
 #include "update_engine/update_manager/policy_test_utils.h"
 
+#include <memory>
 #include <tuple>
 #include <vector>
 
@@ -53,9 +54,9 @@
   fake_state_.updater_provider()->var_last_checked_time()->reset(
       new Time(fake_clock_.GetWallclockTime()));
   fake_state_.updater_provider()->var_consecutive_failed_update_checks()->reset(
-      new unsigned int(0));
+      new unsigned int(0));  // NOLINT(readability/casting)
   fake_state_.updater_provider()->var_server_dictated_poll_interval()->reset(
-      new unsigned int(0));
+      new unsigned int(0));  // NOLINT(readability/casting)
   fake_state_.updater_provider()->var_forced_update_requested()->reset(
       new UpdateRequestStatus{UpdateRequestStatus::kNone});
 
@@ -106,4 +107,4 @@
   return update_state;
 }
 
-}  // namespace chromeos_update_manager
\ No newline at end of file
+}  // namespace chromeos_update_manager
diff --git a/update_manager/policy_test_utils.h b/update_manager/policy_test_utils.h
index 09b2550..5b93f7b 100644
--- a/update_manager/policy_test_utils.h
+++ b/update_manager/policy_test_utils.h
@@ -17,6 +17,7 @@
 #ifndef UPDATE_ENGINE_UPDATE_MANAGER_POLICY_TEST_UTILS_H_
 #define UPDATE_ENGINE_UPDATE_MANAGER_POLICY_TEST_UTILS_H_
 
+#include <memory>
 #include <string>
 
 #include <base/time/time.h>
@@ -32,7 +33,7 @@
 
 class UmPolicyTestBase : public ::testing::Test {
  protected:
-  explicit UmPolicyTestBase() = default;
+  UmPolicyTestBase() = default;
 
   void SetUp() override;
 
@@ -95,4 +96,4 @@
 
 }  // namespace chromeos_update_manager
 
-#endif  // UPDATE_ENGINE_UPDATE_MANAGER_POLICY_TEST_UTILS_H_
\ No newline at end of file
+#endif  // UPDATE_ENGINE_UPDATE_MANAGER_POLICY_TEST_UTILS_H_
diff --git a/update_manager/policy_utils.h b/update_manager/policy_utils.h
index e448022..eaf9ee9 100644
--- a/update_manager/policy_utils.h
+++ b/update_manager/policy_utils.h
@@ -17,6 +17,9 @@
 #ifndef UPDATE_ENGINE_UPDATE_MANAGER_POLICY_UTILS_H_
 #define UPDATE_ENGINE_UPDATE_MANAGER_POLICY_UTILS_H_
 
+#include <string>
+#include <vector>
+
 #include "update_engine/update_manager/policy.h"
 
 // Checks that the passed pointer value is not null, returning kFailed on the
@@ -57,7 +60,7 @@
     }
   }
   return EvalStatus::kContinue;
-};
+}
 
 // Base class implementation that returns |EvalStatus::kContinue| for all
 // decisions, to be used as a base-class for various Policy facets that only
diff --git a/update_manager/real_updater_provider.cc b/update_manager/real_updater_provider.cc
index efa3609..050bd42 100644
--- a/update_manager/real_updater_provider.cc
+++ b/update_manager/real_updater_provider.cc
@@ -73,7 +73,7 @@
 
   inline bool is_success() { return is_success_; }
   inline int64_t last_checked_time() {
-    return update_engine_status_.last_checked_time_ms;
+    return update_engine_status_.last_checked_time;
   }
   inline double progress() { return update_engine_status_.progress; }
   inline const string update_status() {
diff --git a/update_manager/real_updater_provider_unittest.cc b/update_manager/real_updater_provider_unittest.cc
index c25cf5a..b653885 100644
--- a/update_manager/real_updater_provider_unittest.cc
+++ b/update_manager/real_updater_provider_unittest.cc
@@ -73,8 +73,8 @@
   return rounded_time;
 }
 
-ACTION_P(ActionSetUpdateEngineStatusLastCheckedTime, time_ms) {
-  arg0->last_checked_time_ms = time_ms;
+ACTION_P(ActionSetUpdateEngineStatusLastCheckedTime, time) {
+  arg0->last_checked_time = time;
 };
 
 ACTION_P(ActionSetUpdateEngineStatusProgress, progress) {