Revert "update_engine: Support milestones to EOL from Omaha"

This reverts commit 893cae4b0e5141bcaf9f56b1775e681c8f523630.

Reason for revert: use of EOL date and EOL notification date instead milestones to EOL.

Original change's description:
> update_engine: Support milestones to EOL from Omaha
>
> Initiative to show EOL message on Chrome OS devices require that
> update_engine parses the fields within Omaha response that pertain to the
> new milestones to EOL field. The Omaha response will include a new
> field called "milestones_to_eol" which will be an integer value
> string.
>
> The job of update_engine when it comes to milestones to EOL from Omaha
> is to merely forward. No checks and no modifications of fields are
> done within update_engine besides being able to convert the milestones
> to EOL from a string to integer.
>
> BUG=chromium:994999
> TEST=FEATURES="test" emerge-$BOARD update_engine update_engine-client
> TEST=cros deploy $IP update_engine update_engine-client
> TEST=test_that -b $BOARD $IP autoupdate_EOL # from Cq-Depend
> TEST=test_that -b $BOARD $IP autoupdate_EOL.milestones # from Cq-Depend
>
> Cq-Depend:chromium:1761371
> Change-Id: I268e4c8e641b17d6a727a50f53285cc97c76eb22
> Reviewed-on: https://chromium-review.googlesource.com/1759285
> Tested-by: Jae Hoon Kim <kimjae@chromium.org>
> Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
> Reviewed-by: Nicolas Norvez <norvez@chromium.org>
> Reviewed-by: Amin Hassani <ahassani@chromium.org>

TBR=maybelle@chromium.org,norvez@chromium.org,ahassani@chromium.org,abutzier@chromium.org,chromiumos-cl-exonerator@appspot.gserviceaccount.com,kimjae@chromium.org

BUG=chromium:994999
TEST=none
Cq-Depend:chromium:1782971
Change-Id: I42e75e22948b3653500d355027dc3312015c9ebf
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/1782970
Tested-by: Jae Hoon Kim <kimjae@chromium.org>
Commit-Queue: Jae Hoon Kim <kimjae@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/client_library/client_dbus.cc b/client_library/client_dbus.cc
index 3c23de4..e6aba92 100644
--- a/client_library/client_dbus.cc
+++ b/client_library/client_dbus.cc
@@ -271,9 +271,8 @@
   return proxy_->GetLastAttemptError(last_attempt_error, nullptr);
 }
 
-bool DBusUpdateEngineClient::GetEolStatus(int32_t* eol_status,
-                                          int32_t* milestones_to_eol) const {
-  return proxy_->GetEolStatus(eol_status, milestones_to_eol, nullptr);
+bool DBusUpdateEngineClient::GetEolStatus(int32_t* eol_status) const {
+  return proxy_->GetEolStatus(eol_status, nullptr);
 }
 
 }  // namespace internal
diff --git a/client_library/client_dbus.h b/client_library/client_dbus.h
index 3f782e9..c9631cf 100644
--- a/client_library/client_dbus.h
+++ b/client_library/client_dbus.h
@@ -85,8 +85,7 @@
 
   bool GetLastAttemptError(int32_t* last_attempt_error) const override;
 
-  bool GetEolStatus(int32_t* eol_status,
-                    int32_t* milestones_to_eol) const override;
+  bool GetEolStatus(int32_t* eol_status) const override;
 
  private:
   void DBusStatusHandlersRegistered(const std::string& interface,
diff --git a/client_library/include/update_engine/client.h b/client_library/include/update_engine/client.h
index 65a3267..89f36af 100644
--- a/client_library/include/update_engine/client.h
+++ b/client_library/include/update_engine/client.h
@@ -135,10 +135,8 @@
   // Get the last UpdateAttempt error code.
   virtual bool GetLastAttemptError(int32_t* last_attempt_error) const = 0;
 
-  // Get the current end-of-life status code and milestones to end-of-life.
-  // See |EolStatus| enum and |MilestonesToEol| enum for details.
-  virtual bool GetEolStatus(int32_t* eol_status,
-                            int32_t* milestones_to_eol) const = 0;
+  // Get the current end-of-life status code. See EolStatus enum for details.
+  virtual bool GetEolStatus(int32_t* eol_status) const = 0;
 
  protected:
   // Use CreateInstance().
diff --git a/common/constants.cc b/common/constants.cc
index 6f37e16..87bdf91 100644
--- a/common/constants.cc
+++ b/common/constants.cc
@@ -56,7 +56,6 @@
 const char kPrefsOmahaCohortHint[] = "omaha-cohort-hint";
 const char kPrefsOmahaCohortName[] = "omaha-cohort-name";
 const char kPrefsOmahaEolStatus[] = "omaha-eol-status";
-const char kPrefsOmahaMilestonesToEol[] = "omaha-milestones-to-eol";
 const char kPrefsP2PEnabled[] = "p2p-enabled";
 const char kPrefsP2PFirstAttemptTimestamp[] = "p2p-first-attempt-timestamp";
 const char kPrefsP2PNumAttempts[] = "p2p-num-attempts";
diff --git a/common/constants.h b/common/constants.h
index 6034dbd..d95a56a 100644
--- a/common/constants.h
+++ b/common/constants.h
@@ -57,7 +57,6 @@
 extern const char kPrefsOmahaCohortHint[];
 extern const char kPrefsOmahaCohortName[];
 extern const char kPrefsOmahaEolStatus[];
-extern const char kPrefsOmahaMilestonesToEol[];
 extern const char kPrefsP2PEnabled[];
 extern const char kPrefsP2PFirstAttemptTimestamp[];
 extern const char kPrefsP2PNumAttempts[];
diff --git a/common_service.cc b/common_service.cc
index 466007f..0d5ee6d 100644
--- a/common_service.cc
+++ b/common_service.cc
@@ -413,31 +413,18 @@
 }
 
 bool UpdateEngineService::GetEolStatus(ErrorPtr* error,
-                                       int32_t* out_eol_status,
-                                       int32_t* out_milestones_to_eol) {
+                                       int32_t* out_eol_status) {
   PrefsInterface* prefs = system_state_->prefs();
 
-  // Set EOL.
   string str_eol_status;
   if (prefs->Exists(kPrefsOmahaEolStatus) &&
       !prefs->GetString(kPrefsOmahaEolStatus, &str_eol_status)) {
     LogAndSetError(error, FROM_HERE, "Error getting the end-of-life status.");
     return false;
   }
-  // |StringToEolStatus()| will return |kSupported| for invalid values.
+
+  // StringToEolStatus will return kSupported for invalid values.
   *out_eol_status = static_cast<int32_t>(StringToEolStatus(str_eol_status));
-
-  // Set milestones to EOL.
-  string str_milestones_to_eol;
-  if (prefs->Exists(kPrefsOmahaMilestonesToEol) &&
-      !prefs->GetString(kPrefsOmahaMilestonesToEol, &str_milestones_to_eol)) {
-    LogAndSetError(error, FROM_HERE, "Error getting the milestones to EOL.");
-    return false;
-  }
-  // |StringToMilestonesToEol()| will return |kMilestonesToEolNone| for invalid
-  // values.
-  *out_milestones_to_eol = StringToMilestonesToEol(str_milestones_to_eol);
-
   return true;
 }
 
diff --git a/common_service.h b/common_service.h
index 5244e99..f93855d 100644
--- a/common_service.h
+++ b/common_service.h
@@ -153,12 +153,9 @@
   bool GetLastAttemptError(brillo::ErrorPtr* error,
                            int32_t* out_last_attempt_error);
 
-  // Returns the current EOL status of the device and the milestones to
-  // EOL if marked EOL. The values are updated on every update check and
-  // persisted on disk across reboots.
-  bool GetEolStatus(brillo::ErrorPtr* error,
-                    int32_t* out_eol_status,
-                    int32_t* out_milestones_to_eol);
+  // Returns the current end-of-life status of the device. This value is updated
+  // on every update check and persisted on disk across reboots.
+  bool GetEolStatus(brillo::ErrorPtr* error, int32_t* out_eol_status);
 
  private:
   SystemState* system_state_;
diff --git a/common_service_unittest.cc b/common_service_unittest.cc
index 68b2468..65202a0 100644
--- a/common_service_unittest.cc
+++ b/common_service_unittest.cc
@@ -169,90 +169,19 @@
                                UpdateEngineService::kErrorFailed));
 }
 
-TEST_F(UpdateEngineServiceTest, GetEolStatusTestWithMilestonesDefault) {
+TEST_F(UpdateEngineServiceTest, GetEolStatusTest) {
   FakePrefs fake_prefs;
   fake_system_state_.set_prefs(&fake_prefs);
-  // The default value for EOL be |kSupported| and milestone
-  // |kMilestonesToEolNone|.
+  // The default value should be "supported".
   int32_t eol_status = static_cast<int32_t>(EolStatus::kEol);
-  MilestonesToEol milestones_to_eol = kMilestonesToEolNone;
-  EXPECT_TRUE(
-      common_service_.GetEolStatus(&error_, &eol_status, &milestones_to_eol));
+  EXPECT_TRUE(common_service_.GetEolStatus(&error_, &eol_status));
   EXPECT_EQ(nullptr, error_);
   EXPECT_EQ(EolStatus::kSupported, static_cast<EolStatus>(eol_status));
-  EXPECT_EQ(kMilestonesToEolNone, milestones_to_eol);
-}
 
-TEST_F(UpdateEngineServiceTest, GetEolStatusMilestonesToEolNone) {
-  FakePrefs fake_prefs;
-  fake_system_state_.set_prefs(&fake_prefs);
-  int32_t eol_status = static_cast<int32_t>(EolStatus::kEol);
-  MilestonesToEol milestones_to_eol = kMilestonesToEolNone;
-
-  // Device is supported and no milestones to EOL set.
-  fake_prefs.SetString(kPrefsOmahaEolStatus, kEolStatusSupported);
-  EXPECT_TRUE(
-      common_service_.GetEolStatus(&error_, &eol_status, &milestones_to_eol));
-  EXPECT_EQ(nullptr, error_);
-  EXPECT_EQ(EolStatus::kSupported, static_cast<EolStatus>(eol_status));
-  EXPECT_EQ(kMilestonesToEolNone, milestones_to_eol);
-
-  // Device is security only and no milestones to EOL set.
-  fake_prefs.SetString(kPrefsOmahaEolStatus, kEolStatusSecurityOnly);
-  EXPECT_TRUE(
-      common_service_.GetEolStatus(&error_, &eol_status, &milestones_to_eol));
+  fake_prefs.SetString(kPrefsOmahaEolStatus, "security-only");
+  EXPECT_TRUE(common_service_.GetEolStatus(&error_, &eol_status));
   EXPECT_EQ(nullptr, error_);
   EXPECT_EQ(EolStatus::kSecurityOnly, static_cast<EolStatus>(eol_status));
-  EXPECT_EQ(kMilestonesToEolNone, milestones_to_eol);
-
-  // Device is EOL and no milestones to EOL set.
-  fake_prefs.SetString(kPrefsOmahaEolStatus, kEolStatusEol);
-  EXPECT_TRUE(
-      common_service_.GetEolStatus(&error_, &eol_status, &milestones_to_eol));
-  EXPECT_EQ(nullptr, error_);
-  EXPECT_EQ(EolStatus::kEol, static_cast<EolStatus>(eol_status));
-  EXPECT_EQ(kMilestonesToEolNone, milestones_to_eol);
-}
-
-TEST_F(UpdateEngineServiceTest, GetEolStatusMilestonesToEolTwo) {
-  FakePrefs fake_prefs;
-  fake_system_state_.set_prefs(&fake_prefs);
-  int32_t eol_status = static_cast<int32_t>(EolStatus::kEol);
-  MilestonesToEol milestones_to_eol = kMilestonesToEolNone;
-
-  // Device is supported and milestones to EOL is n-2.
-  fake_prefs.SetString(kPrefsOmahaEolStatus, kEolStatusSupported);
-  fake_prefs.SetString(kPrefsOmahaMilestonesToEol, "2");
-  EXPECT_TRUE(
-      common_service_.GetEolStatus(&error_, &eol_status, &milestones_to_eol));
-  EXPECT_EQ(nullptr, error_);
-  EXPECT_EQ(EolStatus::kSupported, static_cast<EolStatus>(eol_status));
-  EXPECT_EQ(2, milestones_to_eol);
-
-  // Device is security only and milestones to EOL is n-2.
-  fake_prefs.SetString(kPrefsOmahaEolStatus, kEolStatusSecurityOnly);
-  fake_prefs.SetString(kPrefsOmahaMilestonesToEol, "2");
-  EXPECT_TRUE(
-      common_service_.GetEolStatus(&error_, &eol_status, &milestones_to_eol));
-  EXPECT_EQ(nullptr, error_);
-  EXPECT_EQ(EolStatus::kSecurityOnly, static_cast<EolStatus>(eol_status));
-  EXPECT_EQ(2, milestones_to_eol);
-}
-
-TEST_F(UpdateEngineServiceTest, GetEolStatusMilestonesToEolZero) {
-  FakePrefs fake_prefs;
-  fake_system_state_.set_prefs(&fake_prefs);
-  int32_t eol_status = static_cast<int32_t>(EolStatus::kEol);
-  MilestonesToEol milestones_to_eol = kMilestonesToEolNone;
-
-  // Device is EOL and milestones to EOL is n.
-  fake_prefs.SetString(kPrefsOmahaEolStatus, kEolStatusEol);
-  fake_prefs.SetString(kPrefsOmahaMilestonesToEol, "0");
-  EXPECT_TRUE(
-      common_service_.GetEolStatus(&error_, &eol_status, &milestones_to_eol));
-  EXPECT_EQ(nullptr, error_);
-  EXPECT_EQ(EolStatus::kEol, static_cast<EolStatus>(eol_status));
-  EXPECT_EQ(0, milestones_to_eol);
 }
 
 }  // namespace chromeos_update_engine
diff --git a/dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml b/dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
index 5671fde..a183147 100644
--- a/dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
+++ b/dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
@@ -139,7 +139,6 @@
     </method>
     <method name="GetEolStatus">
       <arg type="i" name="eol_status" direction="out" />
-      <arg type="i" name="milestones_to_eol" direction="out" />
     </method>
   </interface>
 </node>
diff --git a/dbus_service.cc b/dbus_service.cc
index c4de3e7..b0dc076 100644
--- a/dbus_service.cc
+++ b/dbus_service.cc
@@ -213,9 +213,8 @@
 }
 
 bool DBusUpdateEngineService::GetEolStatus(ErrorPtr* error,
-                                           int32_t* out_eol_status,
-                                           int32_t* out_milestone_to_eol) {
-  return common_->GetEolStatus(error, out_eol_status, out_milestone_to_eol);
+                                           int32_t* out_eol_status) {
+  return common_->GetEolStatus(error, out_eol_status);
 }
 
 UpdateEngineAdaptor::UpdateEngineAdaptor(SystemState* system_state)
diff --git a/dbus_service.h b/dbus_service.h
index 9d79609..2babf8c 100644
--- a/dbus_service.h
+++ b/dbus_service.h
@@ -157,13 +157,8 @@
   bool GetLastAttemptError(brillo::ErrorPtr* error,
                            int32_t* out_last_attempt_error) override;
 
-  // Returns the current EOL status of the device in |out_eol_status| and the
-  // milestones to EOL of the device in |out_milestones_to_eol| for EOL devices.
-  // In the case that milestones to EOL doesn't exists for EOL, it will default
-  // to |kMilestonesToEolNone|.
-  bool GetEolStatus(brillo::ErrorPtr* error,
-                    int32_t* out_eol_status,
-                    int32_t* out_milestones_to_eol) override;
+  // Returns the current end-of-life status of the device in |out_eol_status|.
+  bool GetEolStatus(brillo::ErrorPtr* error, int32_t* out_eol_status) override;
 
  private:
   std::unique_ptr<UpdateEngineService> common_;
diff --git a/omaha_request_action.cc b/omaha_request_action.cc
index 8da7e29..6c67a3b 100644
--- a/omaha_request_action.cc
+++ b/omaha_request_action.cc
@@ -109,7 +109,6 @@
 
 // updatecheck attributes (without the underscore prefix).
 constexpr char kAttrEol[] = "eol";
-constexpr char kAttrMilestonesToEol[] = "milestones_to_eol";
 constexpr char kAttrRollback[] = "rollback";
 constexpr char kAttrFirmwareVersion[] = "firmware_version";
 constexpr char kAttrKernelVersion[] = "kernel_version";
@@ -1316,28 +1315,13 @@
 
 bool OmahaRequestAction::PersistEolStatus(const map<string, string>& attrs) {
   auto eol_attr = attrs.find(kAttrEol);
-  auto milestones_to_eol_attr = attrs.find(kAttrMilestonesToEol);
-
-  bool ret = true;
-  if (milestones_to_eol_attr == attrs.end()) {
-    system_state_->prefs()->Delete(kPrefsOmahaMilestonesToEol);
-    if (eol_attr != attrs.end()) {
-      LOG(WARNING) << "Milestones to EOL missing when EOL.";
-    }
-  } else if (!system_state_->prefs()->SetString(
-                 kPrefsOmahaMilestonesToEol, milestones_to_eol_attr->second)) {
-    LOG(ERROR) << "Setting milestones to EOL failed.";
-    ret = false;
+  if (eol_attr != attrs.end()) {
+    return system_state_->prefs()->SetString(kPrefsOmahaEolStatus,
+                                             eol_attr->second);
+  } else if (system_state_->prefs()->Exists(kPrefsOmahaEolStatus)) {
+    return system_state_->prefs()->Delete(kPrefsOmahaEolStatus);
   }
-
-  if (eol_attr == attrs.end()) {
-    system_state_->prefs()->Delete(kPrefsOmahaEolStatus);
-  } else if (!system_state_->prefs()->SetString(kPrefsOmahaEolStatus,
-                                                eol_attr->second)) {
-    LOG(ERROR) << "Setting EOL failed.";
-    ret = false;
-  }
-  return ret;
+  return true;
 }
 
 void OmahaRequestAction::ActionCompleted(ErrorCode code) {
diff --git a/omaha_request_action.h b/omaha_request_action.h
index 0c256a8..8dffb5c 100644
--- a/omaha_request_action.h
+++ b/omaha_request_action.h
@@ -144,7 +144,6 @@
               GetInstallDateWhenOOBECompletedWithValidDate);
   FRIEND_TEST(OmahaRequestActionTest,
               GetInstallDateWhenOOBECompletedDateChanges);
-  FRIEND_TEST(OmahaRequestActionTest, PersistEolStatusTest);
   friend class UpdateAttempterTest;
   FRIEND_TEST(UpdateAttempterTest, SessionIdTestEnforceEmptyStrPingOmaha);
   FRIEND_TEST(UpdateAttempterTest, SessionIdTestConsistencyInUpdateFlow);
@@ -189,9 +188,8 @@
   bool PersistCohortData(const std::string& prefs_key,
                          const std::string& new_value);
 
-  // Parse and persist the end-of-life status flag and milestones to EOL sent
-  // back in the updatecheck tag attributes. The flag will be validated and
-  // stored in the Prefs.
+  // Parse and persist the end-of-life status flag sent back in the updatecheck
+  // tag attributes. The flag will be validated and stored in the Prefs.
   bool PersistEolStatus(const std::map<std::string, std::string>& attrs);
 
   // If this is an update check request, initializes
diff --git a/omaha_request_action_unittest.cc b/omaha_request_action_unittest.cc
index 11633b6..8008e00 100644
--- a/omaha_request_action_unittest.cc
+++ b/omaha_request_action_unittest.cc
@@ -2012,65 +2012,6 @@
   EXPECT_EQ("security-only", eol_pref);
 }
 
-TEST_F(OmahaRequestActionTest, ParseUpdateCheckAttributesEolTest) {
-  tuc_params_.http_response =
-      "<?xml version=\"1.0\" encoding=\"UTF-8\"?><response "
-      "protocol=\"3.0\"><app appid=\"foo\" status=\"ok\">"
-      "<ping status=\"ok\"/><updatecheck status=\"noupdate\" "
-      "_eol=\"eol\" _milestones_to_eol=\"0\" _foo=\"bar\"/></app></response>";
-  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
-  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
-
-  ASSERT_TRUE(TestUpdateCheck());
-
-  string eol_pref, milestones_to_eol_pref;
-  EXPECT_TRUE(
-      fake_system_state_.prefs()->GetString(kPrefsOmahaEolStatus, &eol_pref));
-  EXPECT_EQ("eol", eol_pref);
-  EXPECT_TRUE(fake_system_state_.prefs()->GetString(kPrefsOmahaMilestonesToEol,
-                                                    &milestones_to_eol_pref));
-  EXPECT_EQ("0", milestones_to_eol_pref);
-}
-
-TEST_F(OmahaRequestActionTest,
-       ParseUpdateCheckAttributesMissingMilestonesToEolTest) {
-  tuc_params_.http_response =
-      "<?xml version=\"1.0\" encoding=\"UTF-8\"?><response "
-      "protocol=\"3.0\"><app appid=\"foo\" status=\"ok\">"
-      "<ping status=\"ok\"/><updatecheck status=\"noupdate\" "
-      "_eol=\"eol\"/></app></response>";
-  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
-  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
-
-  ASSERT_TRUE(TestUpdateCheck());
-
-  string eol_pref, milestones_to_eol_pref;
-  EXPECT_TRUE(
-      fake_system_state_.prefs()->GetString(kPrefsOmahaEolStatus, &eol_pref));
-  EXPECT_EQ("eol", eol_pref);
-  EXPECT_FALSE(fake_system_state_.prefs()->Exists(kPrefsOmahaMilestonesToEol));
-}
-
-TEST_F(OmahaRequestActionTest, ParseUpdateCheckAttributesMilestonesToEolTest) {
-  tuc_params_.http_response =
-      "<?xml version=\"1.0\" encoding=\"UTF-8\"?><response "
-      "protocol=\"3.0\"><app appid=\"foo\" status=\"ok\">"
-      "<ping status=\"ok\"/><updatecheck status=\"noupdate\" "
-      "_eol=\"supported\" _milestones_to_eol=\"3\"/></app></response>";
-  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
-  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
-
-  ASSERT_TRUE(TestUpdateCheck());
-
-  string eol_pref, milestones_to_eol_pref;
-  EXPECT_TRUE(
-      fake_system_state_.prefs()->GetString(kPrefsOmahaEolStatus, &eol_pref));
-  EXPECT_EQ("supported", eol_pref);
-  EXPECT_TRUE(fake_system_state_.prefs()->GetString(kPrefsOmahaMilestonesToEol,
-                                                    &milestones_to_eol_pref));
-  EXPECT_EQ("3", milestones_to_eol_pref);
-}
-
 TEST_F(OmahaRequestActionTest, NoUniqueIDTest) {
   tuc_params_.http_response = "invalid xml>";
   tuc_params_.expected_code = ErrorCode::kOmahaRequestXMLParseError;
diff --git a/omaha_utils.cc b/omaha_utils.cc
index dffa5d3..6bd7525 100644
--- a/omaha_utils.cc
+++ b/omaha_utils.cc
@@ -17,15 +17,17 @@
 #include "update_engine/omaha_utils.h"
 
 #include <base/logging.h>
-#include <base/strings/string_number_conversions.h>
 
 namespace chromeos_update_engine {
 
+namespace {
+
+// The possible string values for the end-of-life status.
 const char kEolStatusSupported[] = "supported";
 const char kEolStatusSecurityOnly[] = "security-only";
 const char kEolStatusEol[] = "eol";
 
-const MilestonesToEol kMilestonesToEolNone = -1;
+}  // namespace
 
 const char* EolStatusToString(EolStatus eol_status) {
   switch (eol_status) {
@@ -48,23 +50,8 @@
     return EolStatus::kSecurityOnly;
   if (eol_status == kEolStatusEol)
     return EolStatus::kEol;
-  LOG(WARNING) << "Invalid EOL attribute: " << eol_status;
+  LOG(WARNING) << "Invalid end-of-life attribute: " << eol_status;
   return EolStatus::kSupported;
 }
 
-std::string MilestonesToEolToString(MilestonesToEol milestones_to_eol) {
-  return base::IntToString(milestones_to_eol);
-}
-
-MilestonesToEol StringToMilestonesToEol(const std::string& milestones_to_eol) {
-  MilestonesToEol milestone = kMilestonesToEolNone;
-  if (!base::StringToInt(milestones_to_eol, &milestone)) {
-    LOG(WARNING) << "Invalid milestones to EOL attribute: "
-                 << milestones_to_eol;
-    return kMilestonesToEolNone;
-  }
-
-  return milestone;
-}
-
 }  // namespace chromeos_update_engine
diff --git a/omaha_utils.h b/omaha_utils.h
index 6000451..8614540 100644
--- a/omaha_utils.h
+++ b/omaha_utils.h
@@ -21,11 +21,6 @@
 
 namespace chromeos_update_engine {
 
-// The possible string values for the end-of-life status.
-extern const char kEolStatusSupported[];
-extern const char kEolStatusSecurityOnly[];
-extern const char kEolStatusEol[];
-
 // The end-of-life status of the device.
 enum class EolStatus {
   kSupported = 0,
@@ -33,10 +28,6 @@
   kEol,
 };
 
-using MilestonesToEol = int;
-// The default milestones to EOL.
-extern const MilestonesToEol kMilestonesToEolNone;
-
 // Returns the string representation of the |eol_status|.
 const char* EolStatusToString(EolStatus eol_status);
 
@@ -44,14 +35,6 @@
 // of an invalid string, the default "supported" value will be used instead.
 EolStatus StringToEolStatus(const std::string& eol_status);
 
-// Returns the string representation of the |milestones_to_eol|.
-std::string MilestonesToEolToString(int milestones_to_eol);
-
-// Converts the milestones to EOL string to an |MilestonesToEol| enum class.
-// When the milestones to EOL is not an integer, the default
-// |kMilestonesToEolNone| will be returned.
-MilestonesToEol StringToMilestonesToEol(const std::string& milestones_to_eol);
-
 }  // namespace chromeos_update_engine
 
 #endif  // UPDATE_ENGINE_OMAHA_UTILS_H_
diff --git a/omaha_utils_unittest.cc b/omaha_utils_unittest.cc
index 59c0366..8ceb76b 100644
--- a/omaha_utils_unittest.cc
+++ b/omaha_utils_unittest.cc
@@ -39,12 +39,4 @@
   EXPECT_EQ(EolStatus::kSupported, StringToEolStatus("hello, world!"));
 }
 
-TEST(OmahaUtilsTest, MilestonesToEolTest) {
-  EXPECT_EQ(kMilestonesToEolNone, StringToMilestonesToEol(""));
-  EXPECT_EQ(kMilestonesToEolNone, StringToMilestonesToEol("not_a_number"));
-  EXPECT_EQ(1, StringToMilestonesToEol("1"));
-  EXPECT_EQ(0, StringToMilestonesToEol("0"));
-  EXPECT_EQ(-1, StringToMilestonesToEol("-1"));
-}
-
 }  // namespace chromeos_update_engine
diff --git a/update_engine_client.cc b/update_engine_client.cc
index 9748c4d..954e856 100644
--- a/update_engine_client.cc
+++ b/update_engine_client.cc
@@ -41,7 +41,6 @@
 
 using chromeos_update_engine::EolStatus;
 using chromeos_update_engine::ErrorCode;
-using chromeos_update_engine::MilestonesToEol;
 using chromeos_update_engine::UpdateEngineStatusToString;
 using chromeos_update_engine::UpdateStatusToString;
 using chromeos_update_engine::utils::ErrorCodeToString;
@@ -560,20 +559,12 @@
   }
 
   if (FLAGS_eol_status) {
-    int eol_status, milestones_to_eol;
-    if (!client_->GetEolStatus(&eol_status, &milestones_to_eol)) {
-      LOG(ERROR) << "Error getting the end-of-life status and milestones to "
-                    "end-of-life.";
+    int eol_status;
+    if (!client_->GetEolStatus(&eol_status)) {
+      LOG(ERROR) << "Error getting the end-of-life status.";
     } else {
       EolStatus eol_status_code = static_cast<EolStatus>(eol_status);
-      MilestonesToEol milestones_to_eol_code = milestones_to_eol;
-      printf(
-          "EOL_STATUS=%s\n"
-          "MILESTONES_TO_EOL=%s\n",
-          EolStatusToString(eol_status_code),
-          chromeos_update_engine::MilestonesToEolToString(
-              milestones_to_eol_code)
-              .c_str());
+      printf("EOL_STATUS=%s\n", EolStatusToString(eol_status_code));
     }
   }