OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "update_engine/update_check_scheduler.h" | 5 #include "update_engine/update_check_scheduler.h" |
6 | 6 |
7 #include "update_engine/utils.h" | 7 #include "update_engine/utils.h" |
8 | 8 |
9 namespace chromeos_update_engine { | 9 namespace chromeos_update_engine { |
10 | 10 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 *next_fuzz = fuzz; | 130 *next_fuzz = fuzz; |
131 } | 131 } |
132 | 132 |
133 void UpdateCheckScheduler::ScheduleNextCheck() { | 133 void UpdateCheckScheduler::ScheduleNextCheck() { |
134 int interval, fuzz; | 134 int interval, fuzz; |
135 ComputeNextIntervalAndFuzz(&interval, &fuzz); | 135 ComputeNextIntervalAndFuzz(&interval, &fuzz); |
136 ScheduleCheck(interval, fuzz); | 136 ScheduleCheck(interval, fuzz); |
137 } | 137 } |
138 | 138 |
139 void UpdateCheckScheduler::SetUpdateStatus(UpdateStatus status) { | 139 void UpdateCheckScheduler::SetUpdateStatus(UpdateStatus status) { |
140 if (status == UPDATE_STATUS_IDLE) { | 140 // We want to schedule the update checks for when we're idle as well as |
| 141 // after we've successfully applied an update and waiting for the user |
| 142 // to reboot to ensure our active count is accurate. |
| 143 if (status == UPDATE_STATUS_IDLE || |
| 144 status == UPDATE_STATUS_UPDATED_NEED_REBOOT) { |
141 ScheduleNextCheck(); | 145 ScheduleNextCheck(); |
142 } | 146 } |
143 } | 147 } |
144 | 148 |
145 } // namespace chromeos_update_engine | 149 } // namespace chromeos_update_engine |
OLD | NEW |