Add flag for restricting downloads
This adds a flag that can be used to turn off the ability to download
and apply updates from the API. This value applies to all future
update checks that the update_engine performs. Changing this value
during an update check has no effect on the current update check.
Bug: 66016687
Test: unit-tests, manual OTA
Change-Id: I655adf23cae44c63079bfa9dc18ba8ca65d7a304
(cherry picked from commit e22f2ddfec92623d38efbf17c17917f68e52907a)
diff --git a/common_service_unittest.cc b/common_service_unittest.cc
index 0a7bfc3..71e42d0 100644
--- a/common_service_unittest.cc
+++ b/common_service_unittest.cc
@@ -28,9 +28,10 @@
#include "update_engine/omaha_utils.h"
using std::string;
+using testing::_;
using testing::Return;
using testing::SetArgumentPointee;
-using testing::_;
+using update_engine::UpdateAttemptFlags;
namespace chromeos_update_engine {
@@ -60,8 +61,7 @@
"app_ver", "url", false /* interactive */));
// The update is non-interactive when we pass the non-interactive flag.
EXPECT_TRUE(common_service_.AttemptUpdate(
- &error_, "app_ver", "url",
- UpdateEngineService::kAttemptUpdateFlagNonInteractive));
+ &error_, "app_ver", "url", UpdateAttemptFlags::kFlagNonInteractive));
EXPECT_EQ(nullptr, error_);
}