update_engine: changes for libchrome r680000 uprev
Changes applied include:
Replace arraysize by base::size.
Replace base::MessageLoop::current()->task_runner by
base::ThreadTaskRunnerHandle::Get, and
base::MessageLoopForIO::current by base::MessageLoopCurrent::IsSet.
Remove use of base::ContainsKey.
Replace base::Int{,64}ToString by base::NumberTostring.
The changes are all compatible with current libchrome r576279.
BUG=chromium:1054279
TEST=unittest
Change-Id: Ibb6027a5070e0e2d4554a6684350168542fedf5e
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2065691
Reviewed-by: Amin Hassani <ahassani@chromium.org>
Tested-by: Qijiang Fan <fqj@google.com>
Commit-Queue: Qijiang Fan <fqj@google.com>
diff --git a/connection_manager.cc b/connection_manager.cc
index ad7e5f6..fe43f37 100644
--- a/connection_manager.cc
+++ b/connection_manager.cc
@@ -89,7 +89,8 @@
if (device_policy->GetAllowedConnectionTypesForUpdate(&allowed_types)) {
// The update setting is enforced by the device policy.
- if (!base::ContainsKey(allowed_types, shill::kTypeCellular)) {
+ // TODO(crbug.com/1054279): Use base::Contains after uprev to r680000.
+ if (allowed_types.find(shill::kTypeCellular) == allowed_types.end()) {
LOG(INFO) << "Disabling updates over cellular connection as it's not "
"allowed in the device policy.";
return false;