recovery: Handle LINEAGE_VERSION_APPEND_TIME_OF_DAY in ver_date
Change-Id: Ia4c4b5e6544e5ac8a88aadd495dbfd06c210828d
diff --git a/recovery.cpp b/recovery.cpp
index 64a7205..ee2e627 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -733,11 +733,12 @@
ui->SetStage(st_cur, st_max);
}
- // Extract the YYYYMMDD date from the full version string. Assume
- // the first instance of "-[0-9]{8}-" (if any) has the desired date.
+ // Extract the YYYYMMDD / YYYYMMDD_HHMMSS timestamp from the full version string.
+ // Assume the first instance of "-[0-9]{8}-", or "-[0-9]{8}_[0-9]{6}-" in case
+ // LINEAGE_VERSION_APPEND_TIME_OF_DAY is set to true has the desired date.
std::string ver = android::base::GetProperty("ro.lineage.version", "");
std::smatch ver_date_match;
- std::regex_search(ver, ver_date_match, std::regex("-(\\d{8})-"));
+ std::regex_search(ver, ver_date_match, std::regex("-(\\d{8}(_\\d{6})?)-"));
std::string ver_date = ver_date_match.str(1); // Empty if no match.
std::vector<std::string> title_lines = {