blob: 3feac7694963e913a8a2722103f3eb69fc38874e [file] [log] [blame]
Casey Dahlina93cd532016-01-14 16:55:11 -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
Sen Jiang96e36722018-05-09 15:17:41 -070017#ifndef UPDATE_ENGINE_PARCELABLE_UPDATE_ENGINE_STATUS_H_
18#define UPDATE_ENGINE_PARCELABLE_UPDATE_ENGINE_STATUS_H_
Casey Dahlina93cd532016-01-14 16:55:11 -080019
20#include <binder/Parcelable.h>
21#include <utils/String16.h>
22
Aaron Wood7f92e2b2017-08-28 14:51:21 -070023#include "update_engine/client_library/include/update_engine/update_status.h"
24
Casey Dahlina93cd532016-01-14 16:55:11 -080025namespace android {
26namespace brillo {
27
28// Parcelable object containing the current status of update engine, to be sent
29// over binder to clients from the server.
30class ParcelableUpdateEngineStatus : public Parcelable {
31 public:
32 ParcelableUpdateEngineStatus() = default;
Aaron Wood7f92e2b2017-08-28 14:51:21 -070033 explicit ParcelableUpdateEngineStatus(
34 const update_engine::UpdateEngineStatus& status);
Casey Dahlina93cd532016-01-14 16:55:11 -080035 virtual ~ParcelableUpdateEngineStatus() = default;
36
37 status_t writeToParcel(Parcel* parcel) const override;
38 status_t readFromParcel(const Parcel* parcel) override;
39
Aaron Wood7f92e2b2017-08-28 14:51:21 -070040 // This list is kept in the Parcelable serialization order.
41
Aaron Wood795c5b42017-12-05 16:06:13 -080042 // When the update_engine last checked for updates (seconds since unix Epoch)
Casey Dahlina93cd532016-01-14 16:55:11 -080043 int64_t last_checked_time_;
Aaron Wood7f92e2b2017-08-28 14:51:21 -070044 // The current status/operation of the update_engine.
Casey Dahlina93cd532016-01-14 16:55:11 -080045 android::String16 current_operation_;
Aaron Wood7f92e2b2017-08-28 14:51:21 -070046 // The current progress (0.0f-1.0f).
47 double progress_;
48 // The current product version.
49 android::String16 current_version_;
50 // The current system version.
51 android::String16 current_system_version_;
52 // The size of the update (bytes). This is int64_t for java compatibility.
Casey Dahlina93cd532016-01-14 16:55:11 -080053 int64_t new_size_;
Aaron Wood7f92e2b2017-08-28 14:51:21 -070054 // The new product version.
55 android::String16 new_version_;
56 // The new system version, if there is one (empty, otherwise).
57 android::String16 new_system_version_;
Casey Dahlina93cd532016-01-14 16:55:11 -080058};
59
60} // namespace brillo
61} // namespace android
62
Sen Jiang96e36722018-05-09 15:17:41 -070063#endif // UPDATE_ENGINE_PARCELABLE_UPDATE_ENGINE_STATUS_H_