parcelable_update_engine_status.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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_PARCELABLE_UPDATE_ENGINE_STATUS_H_
  17. #define UPDATE_ENGINE_PARCELABLE_UPDATE_ENGINE_STATUS_H_
  18. #include <binder/Parcelable.h>
  19. #include <utils/String16.h>
  20. #include "update_engine/client_library/include/update_engine/update_status.h"
  21. namespace android {
  22. namespace brillo {
  23. // Parcelable object containing the current status of update engine, to be sent
  24. // over binder to clients from the server.
  25. class ParcelableUpdateEngineStatus : public Parcelable {
  26. public:
  27. ParcelableUpdateEngineStatus() = default;
  28. explicit ParcelableUpdateEngineStatus(
  29. const update_engine::UpdateEngineStatus& status);
  30. virtual ~ParcelableUpdateEngineStatus() = default;
  31. status_t writeToParcel(Parcel* parcel) const override;
  32. status_t readFromParcel(const Parcel* parcel) override;
  33. // This list is kept in the Parcelable serialization order.
  34. // When the update_engine last checked for updates (seconds since unix Epoch)
  35. int64_t last_checked_time_;
  36. // The current status/operation of the update_engine.
  37. android::String16 current_operation_;
  38. // The current progress (0.0f-1.0f).
  39. double progress_;
  40. // The current product version.
  41. android::String16 current_version_;
  42. // The current system version.
  43. android::String16 current_system_version_;
  44. // The size of the update (bytes). This is int64_t for java compatibility.
  45. int64_t new_size_;
  46. // The new product version.
  47. android::String16 new_version_;
  48. // The new system version, if there is one (empty, otherwise).
  49. android::String16 new_system_version_;
  50. };
  51. } // namespace brillo
  52. } // namespace android
  53. #endif // UPDATE_ENGINE_PARCELABLE_UPDATE_ENGINE_STATUS_H_