service_observer_interface.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #ifndef UPDATE_ENGINE_SERVICE_OBSERVER_INTERFACE_H_
  17. #define UPDATE_ENGINE_SERVICE_OBSERVER_INTERFACE_H_
  18. #include <memory>
  19. #include <string>
  20. #include "update_engine/client_library/include/update_engine/update_status.h"
  21. #include "update_engine/common/error_code.h"
  22. namespace chromeos_update_engine {
  23. class ServiceObserverInterface {
  24. public:
  25. virtual ~ServiceObserverInterface() = default;
  26. // Called whenever the value of these parameters changes. For |progress|
  27. // value changes, this method will be called only if it changes significantly.
  28. virtual void SendStatusUpdate(
  29. const update_engine::UpdateEngineStatus& update_engine_status) = 0;
  30. // Called whenever an update attempt is completed.
  31. virtual void SendPayloadApplicationComplete(ErrorCode error_code) = 0;
  32. protected:
  33. ServiceObserverInterface() = default;
  34. };
  35. } // namespace chromeos_update_engine
  36. #endif // UPDATE_ENGINE_SERVICE_OBSERVER_INTERFACE_H_