From faa566d29f3495e549ee62d7801ecaaccdbbb4c5 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Thu, 29 Oct 2015 13:00:31 -0700 Subject: [PATCH] Use GetBuildTime from libchrome instead of __DATE__ So that this daemon doesn't change on every build, use the system build date from libchrome (which reads ro.build.date). That way we don't have to update this daemon for every OTA. Bug: 24204119 Change-Id: I136d53e5e4ebb9430a57dace66198d8d704d7ca3 --- metricsd/uploader/metrics_log_base.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/metricsd/uploader/metrics_log_base.cc b/metricsd/uploader/metrics_log_base.cc index 311e43a9f..1a60b4fda 100644 --- a/metricsd/uploader/metrics_log_base.cc +++ b/metricsd/uploader/metrics_log_base.cc @@ -16,6 +16,7 @@ #include "uploader/metrics_log_base.h" +#include "base/build_time.h" #include "base/metrics/histogram_base.h" #include "base/metrics/histogram_samples.h" #include "uploader/metrics_hashes.h" @@ -82,10 +83,7 @@ uint64_t MetricsLogBase::Hash(const std::string& value) { int64_t MetricsLogBase::GetBuildTime() { static int64_t integral_build_time = 0; if (!integral_build_time) { - Time time; - const char* kDateTime = __DATE__ " " __TIME__ " GMT"; - bool result = Time::FromString(kDateTime, &time); - DCHECK(result); + Time time = base::GetBuildTime(); integral_build_time = static_cast(time.ToTimeT()); } return integral_build_time;