blob: c55f7535c6754fd11b2e4d51a315fda6de0adf39 [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
Christopher Wiley16daa082015-10-01 17:18:40 -070026#include "update_engine/client_library/include/update_engine/client.h"
Alex Deymo39910dc2015-11-09 17:04:30 -080027#include "update_engine/dbus-proxies.h"
Christopher Wiley16daa082015-10-01 17:18:40 -070028
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
Casey Dahline844c1a2015-12-16 14:30:58 -080047 bool ResetStatus() override;
48
Casey Dahlin87ab88e2015-12-16 17:58:05 -080049 bool SetTargetChannel(const std::string& target_channel,
50 bool allow_powerwash) override;
Christopher Wiley16daa082015-10-01 17:18:40 -070051
52 bool GetTargetChannel(std::string* out_channel) override;
53
54 bool GetChannel(std::string* out_channel) override;
55
56 private:
57 std::unique_ptr<org::chromium::UpdateEngineInterfaceProxy> proxy_;
58
59 DISALLOW_COPY_AND_ASSIGN(UpdateEngineClientImpl);
60}; // class UpdateEngineClientImpl
61
62} // namespace internal
63} // namespace update_engine
64
65#endif // UPDATE_ENGINE_CLIENT_LIBRARY_CLIENT_IMPL_H_