blob: a16136cd6ff5c1e4fe5e95a94e6a8f26a7f1bc6e [file] [log] [blame]
Christopher Wiley16daa082015-10-01 17:18:40 -07001//
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
26#include "update_engine/dbus-proxies.h"
27#include "update_engine/client_library/include/update_engine/client.h"
28
29namespace update_engine {
30namespace internal {
31
32class 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
47 bool SetTargetChannel(const std::string& target_channel) override;
48
49 bool GetTargetChannel(std::string* out_channel) override;
50
51 bool GetChannel(std::string* out_channel) override;
52
53 private:
54 std::unique_ptr<org::chromium::UpdateEngineInterfaceProxy> proxy_;
55
56 DISALLOW_COPY_AND_ASSIGN(UpdateEngineClientImpl);
57}; // class UpdateEngineClientImpl
58
59} // namespace internal
60} // namespace update_engine
61
62#endif // UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_IMPL_H_