diff options
author | Dan Willemsen <dwillemsen@google.com> | 2015-10-28 18:11:23 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2015-10-29 12:14:34 -0700 |
commit | 8b7977eccc94f6b3a3896cd13b4aeacbfa1e0f84 (patch) | |
tree | 1c5f0a738387ff55aacd94fc9de6d8a7d33bc89b /base | |
parent | 5e3f7a49613f24ed1a169179b77fbb4c7eb0f08f (diff) | |
download | libchrome-8b7977eccc94f6b3a3896cd13b4aeacbfa1e0f84.tar.gz |
Don't use __DATE__/__TIME__ on Androidbrillo-m7-releasebrillo-m7-mr-devbrillo-m7-dev
Instead, pull the build date of the system from the ro.build.date system
property. Then this library will be identical as long as the sources and
dependencies don't change, and we won't have to update it on every OTA.
Bug: 24204119
Change-Id: Ie5368ec0bbbc635dc6b86f9259d6567fe26ca2ba
Diffstat (limited to 'base')
-rw-r--r-- | base/build_time.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/base/build_time.cc b/base/build_time.cc index b8b4296690..866840d49f 100644 --- a/base/build_time.cc +++ b/base/build_time.cc @@ -7,6 +7,10 @@ #include "base/logging.h" #include "base/time/time.h" +#ifdef __ANDROID__ +#include <cutils/properties.h> +#endif + namespace base { Time GetBuildTime() { @@ -16,7 +20,10 @@ Time GetBuildTime() { // // __DATE__ is exactly "Mmm DD YYYY". // __TIME__ is exactly "hh:mm:ss". -#if defined(DONT_EMBED_BUILD_METADATA) && !defined(OFFICIAL_BUILD) +#if defined(__ANDROID__) + char kDateTime[PROPERTY_VALUE_MAX]; + property_get("ro.build.date", kDateTime, "Sep 02 2008 08:00:00 PST"); +#elif defined(DONT_EMBED_BUILD_METADATA) && !defined(OFFICIAL_BUILD) const char kDateTime[] = "Sep 02 2008 08:00:00 PST"; #else const char kDateTime[] = __DATE__ " " __TIME__ " PST"; |