Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Unified Diff: update_attempter.cc

Issue 6880077: AU: Handle firmware update failure when booted from FW slot B. (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « update_attempter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: update_attempter.cc
diff --git a/update_attempter.cc b/update_attempter.cc
index 61c9947a787b21246200d20b33bf7019aa21b908..131408610524c83f676e8f86785d631360f721c9 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -103,6 +103,7 @@ UpdateAttempter::UpdateAttempter(PrefsInterface* prefs,
prefs_(prefs),
metrics_lib_(metrics_lib),
update_check_scheduler_(NULL),
+ fake_update_success_(false),
http_response_code_(0),
priority_(utils::kProcessPriorityNormal),
manage_priority_source_(NULL),
@@ -129,6 +130,7 @@ void UpdateAttempter::Update(const std::string& app_version,
const std::string& omaha_url,
bool obey_proxies) {
chrome_proxy_resolver_.Init();
+ fake_update_success_ = false;
UpdateBootFlags(); // Just in case we didn't do this yet.
if (status_ == UPDATE_STATUS_UPDATED_NEED_REBOOT) {
// Although we have applied an update, we still want to ping Omaha
@@ -314,7 +316,11 @@ void UpdateAttempter::ProcessingDone(const ActionProcessor* processor,
if (status_ == UPDATE_STATUS_REPORTING_ERROR_EVENT) {
LOG(INFO) << "Error event sent.";
SetStatusAndNotify(UPDATE_STATUS_IDLE);
- return;
+ if (!fake_update_success_) {
+ return;
+ }
+ LOG(INFO) << "Booted from FW B and tried to install new firmware, "
+ "so requesting reboot from user.";
}
if (code == kActionCodeSuccess) {
@@ -326,11 +332,12 @@ void UpdateAttempter::ProcessingDone(const ActionProcessor* processor,
// Report the time it took to update the system.
int64_t update_time = time(NULL) - last_checked_time_;
- metrics_lib_->SendToUMA("Installer.UpdateTime",
- static_cast<int>(update_time), // sample
- 1, // min = 1 second
- 20 * 60, // max = 20 minutes
- 50); // buckets
+ if (!fake_update_success_)
+ metrics_lib_->SendToUMA("Installer.UpdateTime",
+ static_cast<int>(update_time), // sample
+ 1, // min = 1 second
+ 20 * 60, // max = 20 minutes
+ 50); // buckets
return;
}
@@ -511,6 +518,7 @@ void UpdateAttempter::CreatePendingErrorEvent(AbstractAction* action,
}
code = GetErrorCodeForAction(action, code);
+ fake_update_success_ = code == kActionCodePostinstallBootedFromFirmwareB;
error_event_.reset(new OmahaEvent(OmahaEvent::kTypeUpdateComplete,
OmahaEvent::kResultError,
code));
« no previous file with comments | « update_attempter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698