blob: e0fac00e7bab1b92629eccd14406c7dd9156b0f9 [file] [log] [blame]
Alex Deymofa78f142016-01-26 21:36:16 -08001//
2// Copyright (C) 2016 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_DAEMON_STATE_ANDROID_H_
18#define UPDATE_ENGINE_DAEMON_STATE_ANDROID_H_
19
20#include <set>
21
22#include "update_engine/daemon_state_interface.h"
Alex Deymof8bfcff2016-02-02 21:22:11 -080023#include "update_engine/service_delegate_android_interface.h"
Alex Deymofa78f142016-01-26 21:36:16 -080024#include "update_engine/service_observer_interface.h"
25
26namespace chromeos_update_engine {
27
28class DaemonStateAndroid : public DaemonStateInterface {
29 public:
30 DaemonStateAndroid() = default;
Alex Deymof8bfcff2016-02-02 21:22:11 -080031 ~DaemonStateAndroid() override = default;
Alex Deymofa78f142016-01-26 21:36:16 -080032
33 bool Initialize();
34
35 // DaemonStateInterface overrides.
36 bool StartUpdater() override;
37 void AddObserver(ServiceObserverInterface* observer) override;
38 void RemoveObserver(ServiceObserverInterface* observer) override;
39
Alex Deymof8bfcff2016-02-02 21:22:11 -080040 const std::set<ServiceObserverInterface*>& service_observers() {
41 return service_observers_;
42 }
43
44 // Return a pointer to the service delegate.
45 ServiceDelegateAndroidInterface* service_delegate();
46
Alex Deymofa78f142016-01-26 21:36:16 -080047 protected:
48 std::set<ServiceObserverInterface*> service_observers_;
49};
50
51} // namespace chromeos_update_engine
52
53#endif // UPDATE_ENGINE_DAEMON_STATE_ANDROID_H_