Christopher Wiley | 16daa08 | 2015-10-01 17:18:40 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2015 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | |
| 17 | #ifndef UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_IMPL_H_ |
| 18 | #define UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_IMPL_H_ |
| 19 | |
| 20 | #include <cstdint> |
| 21 | #include <memory> |
| 22 | #include <string> |
| 23 | |
| 24 | #include <base/macros.h> |
| 25 | |
Christopher Wiley | 16daa08 | 2015-10-01 17:18:40 -0700 | [diff] [blame] | 26 | #include "update_engine/client_library/include/update_engine/client.h" |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 27 | #include "update_engine/dbus-proxies.h" |
Christopher Wiley | 16daa08 | 2015-10-01 17:18:40 -0700 | [diff] [blame] | 28 | |
| 29 | namespace update_engine { |
| 30 | namespace internal { |
| 31 | |
| 32 | class UpdateEngineClientImpl : public UpdateEngineClient { |
| 33 | public: |
| 34 | UpdateEngineClientImpl(); |
| 35 | virtual ~UpdateEngineClientImpl() = default; |
| 36 | |
| 37 | bool AttemptUpdate(const std::string& app_version, |
| 38 | const std::string& omaha_url, |
| 39 | bool at_user_request) override; |
| 40 | |
| 41 | bool GetStatus(int64_t* out_last_checked_time, |
| 42 | double* out_progress, |
| 43 | UpdateStatus* out_update_status, |
| 44 | std::string* out_new_version, |
| 45 | int64_t* out_new_size) override; |
| 46 | |
Casey Dahlin | e844c1a | 2015-12-16 14:30:58 -0800 | [diff] [blame^] | 47 | bool ResetStatus() override; |
| 48 | |
Christopher Wiley | 16daa08 | 2015-10-01 17:18:40 -0700 | [diff] [blame] | 49 | bool SetTargetChannel(const std::string& target_channel) override; |
| 50 | |
| 51 | bool GetTargetChannel(std::string* out_channel) override; |
| 52 | |
| 53 | bool GetChannel(std::string* out_channel) override; |
| 54 | |
| 55 | private: |
| 56 | std::unique_ptr<org::chromium::UpdateEngineInterfaceProxy> proxy_; |
| 57 | |
| 58 | DISALLOW_COPY_AND_ASSIGN(UpdateEngineClientImpl); |
| 59 | }; // class UpdateEngineClientImpl |
| 60 | |
| 61 | } // namespace internal |
| 62 | } // namespace update_engine |
| 63 | |
| 64 | #endif // UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_IMPL_H_ |