Small cleanups in UpdateAttempter.
Removed some unimplemented declarations.
Removed some unused header and using statement.
Changed GetCurrentUpdateAttemptFlags() to const.
Removed virtual from IsAnyUpdateSourceAllowed() and made it const.
Moved GetErrorCodeFlags() to private.
Test: mma
Change-Id: I619d0cc0300fa918ffbab67ffff8067c1d23b550
diff --git a/update_attempter.cc b/update_attempter.cc
index db373ab..63d8a61 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -20,7 +20,6 @@
#include <algorithm>
#include <memory>
-#include <set>
#include <string>
#include <utility>
#include <vector>
@@ -47,7 +46,6 @@
#include "update_engine/common/prefs_interface.h"
#include "update_engine/common/subprocess.h"
#include "update_engine/common/utils.h"
-#include "update_engine/connection_manager_interface.h"
#include "update_engine/libcurl_http_fetcher.h"
#include "update_engine/metrics_reporter_interface.h"
#include "update_engine/omaha_request_action.h"
@@ -77,8 +75,6 @@
using chromeos_update_manager::UpdateCheckParams;
using chromeos_update_manager::CalculateStagingCase;
using chromeos_update_manager::StagingCase;
-using std::set;
-using std::shared_ptr;
using std::string;
using std::vector;
using update_engine::UpdateAttemptFlags;
@@ -106,8 +102,7 @@
// to |action| (e.g., ErrorCode::kFilesystemVerifierError). If |code| is
// not ErrorCode::kError, or the action is not matched, returns |code|
// unchanged.
-ErrorCode GetErrorCodeForAction(AbstractAction* action,
- ErrorCode code) {
+ErrorCode GetErrorCodeForAction(AbstractAction* action, ErrorCode code) {
if (code != ErrorCode::kError)
return code;
@@ -1291,8 +1286,7 @@
if (!system_state_->hardware()->IsOfficialBuild())
flags |= static_cast<uint32_t>(ErrorCode::kTestImageFlag);
- if (omaha_request_params_->update_url() !=
- constants::kOmahaDefaultProductionURL) {
+ if (!omaha_request_params_->IsUpdateUrlOfficial()) {
flags |= static_cast<uint32_t>(ErrorCode::kTestOmahaUrlFlag);
}
@@ -1589,7 +1583,7 @@
waiting_for_scheduled_check_);
}
-bool UpdateAttempter::IsAnyUpdateSourceAllowed() {
+bool UpdateAttempter::IsAnyUpdateSourceAllowed() const {
// We allow updates from any source if either of these are true:
// * The device is running an unofficial (dev/test) image.
// * The debugd dev features are accessible (i.e. in devmode with no owner).