Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 1 | // |
| 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 Deymo | f8bfcff | 2016-02-02 21:22:11 -0800 | [diff] [blame] | 23 | #include "update_engine/service_delegate_android_interface.h" |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 24 | #include "update_engine/service_observer_interface.h" |
| 25 | |
| 26 | namespace chromeos_update_engine { |
| 27 | |
| 28 | class DaemonStateAndroid : public DaemonStateInterface { |
| 29 | public: |
| 30 | DaemonStateAndroid() = default; |
Alex Deymo | f8bfcff | 2016-02-02 21:22:11 -0800 | [diff] [blame] | 31 | ~DaemonStateAndroid() override = default; |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 32 | |
| 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 Deymo | f8bfcff | 2016-02-02 21:22:11 -0800 | [diff] [blame] | 40 | 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 Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 47 | protected: |
| 48 | std::set<ServiceObserverInterface*> service_observers_; |
| 49 | }; |
| 50 | |
| 51 | } // namespace chromeos_update_engine |
| 52 | |
| 53 | #endif // UPDATE_ENGINE_DAEMON_STATE_ANDROID_H_ |