blob: ff6114d28730b972588699a73e84004a7cff7ab3 [file] [log] [blame]
Tianjiea2076132020-08-19 17:25:32 -07001/*
2 * Copyright (C) 2020 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
17syntax = "proto3";
18
19package build.tools.releasetools;
20option optimize_for = LITE_RUNTIME;
21
22// The build information of a particular partition on the device.
23message PartitionState {
24 string partition_name = 1;
25 repeated string device = 2;
26 repeated string build = 3;
27 // The version string of the partition. It's usually timestamp if present.
28 // One known exception is the boot image, who uses the kmi version, e.g.
29 // 5.4.42-android12-0
30 string version = 4;
31
32 // TODO(xunchang), revisit other necessary fields, e.g. security_patch_level.
33}
34
35// The build information on the device. The bytes of the running images are thus
36// inferred from the device state. For more information of the meaning of each
37// subfield, check
38// https://source.android.com/compatibility/android-cdd#3_2_2_build_parameters
39message DeviceState {
40 // device name. i.e. ro.product.device; if the field has multiple values, it
41 // means the ota package supports multiple devices. This usually happens when
42 // we use the same image to support multiple skus.
43 repeated string device = 1;
44 // device fingerprint. Up to R build, the value reads from
45 // ro.build.fingerprint.
46 repeated string build = 2;
47 // A value that specify a version of the android build.
48 string build_incremental = 3;
49 // The timestamp when the build is generated.
50 int64 timestamp = 4;
51 // The version of the currently-executing Android system.
52 string sdk_level = 5;
53 // A value indicating the security patch level of a build.
54 string security_patch_level = 6;
55
56 // The detailed state of each partition. For partial updates or devices with
57 // mixed build of partitions, some of the above fields may left empty. And the
58 // client will rely on the information of specific partitions to target the
59 // update.
60 repeated PartitionState partition_state = 7;
61}
62
63// The metadata of an OTA package. It contains the information of the package
64// and prerequisite to install the update correctly.
65message OtaMetadata {
66 enum OtaType {
Tianjied5563372020-08-31 14:06:31 -070067 UNKNOWN = 0;
68 AB = 1;
69 BLOCK = 2;
70 BRICK = 3;
Tianjiea2076132020-08-19 17:25:32 -070071 };
72 OtaType type = 1;
73 // True if we need to wipe after the update.
74 bool wipe = 2;
75 // True if the timestamp of the post build is older than the pre build.
76 bool downgrade = 3;
77 // A map of name:content of property files, e.g. ota-property-files.
78 map<string, string> property_files = 4;
79
80 // The required device state in order to install the package.
81 DeviceState precondition = 5;
82 // The expected device state after the update.
83 DeviceState postcondition = 6;
84
85 // True if the ota that updates a device to support dynamic partitions, where
86 // the source build doesn't support it.
87 bool retrofit_dynamic_partitions = 7;
88 // The required size of the cache partition, only valid for non-A/B update.
89 int64 required_cache = 8;
90}