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

Unified Diff: chromeos/dbus/update_engine_client.cc

Issue 2694923005: Appropriate handling for Cellular First devices. (Closed)
Patch Set: Created 3 years, 10 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
Index: chromeos/dbus/update_engine_client.cc
diff --git a/chromeos/dbus/update_engine_client.cc b/chromeos/dbus/update_engine_client.cc
index d772d0074513b7cbf9ddf6cd6ab55430c37faf95..23646c606bc583016a10e47f68940766194783b4 100644
--- a/chromeos/dbus/update_engine_client.cc
+++ b/chromeos/dbus/update_engine_client.cc
@@ -218,6 +218,17 @@ class UpdateEngineClientImpl : public UpdateEngineClient {
weak_ptr_factory_.GetWeakPtr(), callback));
}
+ std::unique_ptr<dbus::Response> SetUpdateOverCellularPermission(
+ bool allowed) override {
+ dbus::MethodCall method_call(
+ update_engine::kUpdateEngineInterface,
+ update_engine::kSetUpdateOverCellularPermission);
+ VLOG(1) << "Requesting UpdateEngine to " << (allowed ? "allow" : "prohibit")
+ << " updates over cellular.";
+ return update_engine_proxy_->CallMethodAndBlock(
+ &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT);
+ }
+
protected:
void Init(dbus::Bus* bus) override {
update_engine_proxy_ = bus->GetObjectProxy(
@@ -449,7 +460,8 @@ class UpdateEngineClientStubImpl : public UpdateEngineClient {
public:
UpdateEngineClientStubImpl()
: current_channel_(kReleaseChannelBeta),
- target_channel_(kReleaseChannelBeta) {}
+ target_channel_(kReleaseChannelBeta),
+ method_call_("com.example.Interface", "SomeMethod") {}
// UpdateEngineClient implementation:
void Init(dbus::Bus* bus) override {}
@@ -487,8 +499,14 @@ class UpdateEngineClientStubImpl : public UpdateEngineClient {
callback.Run(update_engine::EndOfLifeStatus::kSupported);
}
+ std::unique_ptr<dbus::Response> SetUpdateOverCellularPermission(
+ bool allowed) override {
+ return dbus::Response::FromMethodCall(&method_call_);
+ }
+
std::string current_channel_;
std::string target_channel_;
+ dbus::MethodCall method_call_;
};
// The UpdateEngineClient implementation used on Linux desktop, which
« chrome/browser/ui/webui/help/help_utils_chromeos.cc ('K') | « chromeos/dbus/update_engine_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698