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

Side by Side Diff: chromeos/dbus/update_engine_client.h

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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium 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 #ifndef CHROMEOS_DBUS_UPDATE_ENGINE_CLIENT_H_ 5 #ifndef CHROMEOS_DBUS_UPDATE_ENGINE_CLIENT_H_
6 #define CHROMEOS_DBUS_UPDATE_ENGINE_CLIENT_H_ 6 #define CHROMEOS_DBUS_UPDATE_ENGINE_CLIENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/observer_list.h" 14 #include "base/observer_list.h"
15 #include "chromeos/chromeos_export.h" 15 #include "chromeos/chromeos_export.h"
16 #include "chromeos/dbus/dbus_client.h" 16 #include "chromeos/dbus/dbus_client.h"
17 #include "chromeos/dbus/dbus_client_implementation_type.h" 17 #include "chromeos/dbus/dbus_client_implementation_type.h"
18 #include "dbus/message.h"
18 #include "third_party/cros_system_api/dbus/update_engine/dbus-constants.h" 19 #include "third_party/cros_system_api/dbus/update_engine/dbus-constants.h"
19 20
20 namespace chromeos { 21 namespace chromeos {
21 22
22 // UpdateEngineClient is used to communicate with the update engine. 23 // UpdateEngineClient is used to communicate with the update engine.
23 class CHROMEOS_EXPORT UpdateEngineClient : public DBusClient { 24 class CHROMEOS_EXPORT UpdateEngineClient : public DBusClient {
24 public: 25 public:
25 // Edges for state machine 26 // Edges for state machine
26 // IDLE->CHECKING_FOR_UPDATE 27 // IDLE->CHECKING_FOR_UPDATE
27 // CHECKING_FOR_UPDATE->IDLE 28 // CHECKING_FOR_UPDATE->IDLE
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 const GetChannelCallback& callback) = 0; 136 const GetChannelCallback& callback) = 0;
136 137
137 // Called once GetEolStatus() is complete. Takes one parameter; 138 // Called once GetEolStatus() is complete. Takes one parameter;
138 // - EndOfLife Status: the end of life status of the device. 139 // - EndOfLife Status: the end of life status of the device.
139 typedef base::Callback<void(update_engine::EndOfLifeStatus status)> 140 typedef base::Callback<void(update_engine::EndOfLifeStatus status)>
140 GetEolStatusCallback; 141 GetEolStatusCallback;
141 142
142 // Get EndOfLife status of the device and calls |callback| when completed. 143 // Get EndOfLife status of the device and calls |callback| when completed.
143 virtual void GetEolStatus(const GetEolStatusCallback& callback) = 0; 144 virtual void GetEolStatus(const GetEolStatusCallback& callback) = 0;
144 145
146 // Either allow or disallow receiving updates over cellular connections.
147 // Synchronous (blocking) method.
148 virtual std::unique_ptr<dbus::Response> SetUpdateOverCellularPermission(
149 bool allowed);
150
145 // Returns an empty UpdateCheckCallback that does nothing. 151 // Returns an empty UpdateCheckCallback that does nothing.
146 static UpdateCheckCallback EmptyUpdateCheckCallback(); 152 static UpdateCheckCallback EmptyUpdateCheckCallback();
147 153
148 // Creates the instance. 154 // Creates the instance.
149 static UpdateEngineClient* Create(DBusClientImplementationType type); 155 static UpdateEngineClient* Create(DBusClientImplementationType type);
150 156
151 // Returns true if |target_channel| is more stable than |current_channel|. 157 // Returns true if |target_channel| is more stable than |current_channel|.
152 static bool IsTargetChannelMoreStable(const std::string& current_channel, 158 static bool IsTargetChannelMoreStable(const std::string& current_channel,
153 const std::string& target_channel); 159 const std::string& target_channel);
154 160
155 protected: 161 protected:
156 // Create() should be used instead. 162 // Create() should be used instead.
157 UpdateEngineClient(); 163 UpdateEngineClient();
158 164
159 private: 165 private:
160 DISALLOW_COPY_AND_ASSIGN(UpdateEngineClient); 166 DISALLOW_COPY_AND_ASSIGN(UpdateEngineClient);
161 }; 167 };
162 168
163 } // namespace chromeos 169 } // namespace chromeos
164 170
165 #endif // CHROMEOS_DBUS_UPDATE_ENGINE_CLIENT_H_ 171 #endif // CHROMEOS_DBUS_UPDATE_ENGINE_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698