Loading bootstat/boot_event_record_store.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <utility> #include <android-base/file.h> #include <android-base/logging.h> #include <android-base/parseint.h> #include "histogram_logger.h" #include "uptime_parser.h" Loading Loading @@ -57,9 +58,11 @@ bool ParseRecordEventTime(const std::string& path, int32_t* uptime) { // Ignore existing bootstat records (which do not contain file content). if (!content.empty()) { int32_t value = std::stoi(content); int32_t value; if (android::base::ParseInt(content.c_str(), &value)) { bootstat::LogHistogram("bootstat_mtime_matches_content", value == *uptime); } } return true; } Loading bootstat/bootstat.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include <memory> #include <string> #include <android-base/logging.h> #include <android-base/parseint.h> #include <cutils/properties.h> #include <log/log.h> #include "boot_event_record_store.h" Loading Loading @@ -147,7 +148,10 @@ std::string CalculateBootCompletePrefix() { std::string boot_complete_prefix = "boot_complete"; std::string build_date_str = GetProperty("ro.build.date.utc"); int32_t build_date = std::stoi(build_date_str); int32_t build_date; if (!android::base::ParseInt(build_date_str.c_str(), &build_date)) { return std::string(); } BootEventRecordStore boot_event_store; BootEventRecordStore::BootEventRecord record; Loading @@ -171,6 +175,10 @@ void RecordBootComplete() { // ota_boot_complete. The latter signifies that the device is booting after // a system update. std::string boot_complete_prefix = CalculateBootCompletePrefix(); if (boot_complete_prefix.empty()) { // The system is hosed because the build date property could not be read. return; } // post_decrypt_time_elapsed is only logged on encrypted devices. if (boot_event_store.GetBootEvent("post_decrypt_time_elapsed", &record)) { Loading Loading
bootstat/boot_event_record_store.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <utility> #include <android-base/file.h> #include <android-base/logging.h> #include <android-base/parseint.h> #include "histogram_logger.h" #include "uptime_parser.h" Loading Loading @@ -57,9 +58,11 @@ bool ParseRecordEventTime(const std::string& path, int32_t* uptime) { // Ignore existing bootstat records (which do not contain file content). if (!content.empty()) { int32_t value = std::stoi(content); int32_t value; if (android::base::ParseInt(content.c_str(), &value)) { bootstat::LogHistogram("bootstat_mtime_matches_content", value == *uptime); } } return true; } Loading
bootstat/bootstat.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include <memory> #include <string> #include <android-base/logging.h> #include <android-base/parseint.h> #include <cutils/properties.h> #include <log/log.h> #include "boot_event_record_store.h" Loading Loading @@ -147,7 +148,10 @@ std::string CalculateBootCompletePrefix() { std::string boot_complete_prefix = "boot_complete"; std::string build_date_str = GetProperty("ro.build.date.utc"); int32_t build_date = std::stoi(build_date_str); int32_t build_date; if (!android::base::ParseInt(build_date_str.c_str(), &build_date)) { return std::string(); } BootEventRecordStore boot_event_store; BootEventRecordStore::BootEventRecord record; Loading @@ -171,6 +175,10 @@ void RecordBootComplete() { // ota_boot_complete. The latter signifies that the device is booting after // a system update. std::string boot_complete_prefix = CalculateBootCompletePrefix(); if (boot_complete_prefix.empty()) { // The system is hosed because the build date property could not be read. return; } // post_decrypt_time_elapsed is only logged on encrypted devices. if (boot_event_store.GetBootEvent("post_decrypt_time_elapsed", &record)) { Loading