blob: ed9d0c3cf79c5568747c4876da381f8fa54de5df [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
Kelvin Zhang4d50ea42020-08-31 11:41:44 -040017// If you change this file,
18// Please update ota_metadata_pb2.py by executing
Kelvin Zhang5f0fcee2021-01-19 15:30:46 -050019// protoc ota_metadata.proto --python_out
20// $ANDROID_BUILD_TOP/build/tools/releasetools
Kelvin Zhang4d50ea42020-08-31 11:41:44 -040021
Tianjiea2076132020-08-19 17:25:32 -070022syntax = "proto3";
23
24package build.tools.releasetools;
25option optimize_for = LITE_RUNTIME;
Kelvin Zhang2b6a9c32021-04-12 17:24:26 -040026option java_package = "android.ota";
27option java_outer_classname = "OtaPackageMetadata";
Tianjiea2076132020-08-19 17:25:32 -070028
29// The build information of a particular partition on the device.
30message PartitionState {
31 string partition_name = 1;
32 repeated string device = 2;
33 repeated string build = 3;
34 // The version string of the partition. It's usually timestamp if present.
35 // One known exception is the boot image, who uses the kmi version, e.g.
36 // 5.4.42-android12-0
37 string version = 4;
38
39 // TODO(xunchang), revisit other necessary fields, e.g. security_patch_level.
40}
41
42// The build information on the device. The bytes of the running images are thus
43// inferred from the device state. For more information of the meaning of each
44// subfield, check
45// https://source.android.com/compatibility/android-cdd#3_2_2_build_parameters
46message DeviceState {
47 // device name. i.e. ro.product.device; if the field has multiple values, it
48 // means the ota package supports multiple devices. This usually happens when
49 // we use the same image to support multiple skus.
50 repeated string device = 1;
51 // device fingerprint. Up to R build, the value reads from
52 // ro.build.fingerprint.
53 repeated string build = 2;
54 // A value that specify a version of the android build.
55 string build_incremental = 3;
56 // The timestamp when the build is generated.
57 int64 timestamp = 4;
58 // The version of the currently-executing Android system.
59 string sdk_level = 5;
60 // A value indicating the security patch level of a build.
61 string security_patch_level = 6;
62
63 // The detailed state of each partition. For partial updates or devices with
64 // mixed build of partitions, some of the above fields may left empty. And the
65 // client will rely on the information of specific partitions to target the
66 // update.
67 repeated PartitionState partition_state = 7;
68}
69
Mohammad Samiul Islam9fd58862021-01-06 13:33:25 +000070message ApexInfo {
71 string package_name = 1;
72 int64 version = 2;
73 bool is_compressed = 3;
74 int64 decompressed_size = 4;
75}
76
Kelvin Zhang5f0fcee2021-01-19 15:30:46 -050077// Just a container to hold repeated apex_info, so that we can easily serialize
78// a list of apex_info to string.
79message ApexMetadata {
80 repeated ApexInfo apex_info = 1;
81}
82
Tianjiea2076132020-08-19 17:25:32 -070083// The metadata of an OTA package. It contains the information of the package
84// and prerequisite to install the update correctly.
85message OtaMetadata {
86 enum OtaType {
Tianjied5563372020-08-31 14:06:31 -070087 UNKNOWN = 0;
88 AB = 1;
89 BLOCK = 2;
90 BRICK = 3;
Tianjiea2076132020-08-19 17:25:32 -070091 };
92 OtaType type = 1;
93 // True if we need to wipe after the update.
94 bool wipe = 2;
95 // True if the timestamp of the post build is older than the pre build.
96 bool downgrade = 3;
97 // A map of name:content of property files, e.g. ota-property-files.
98 map<string, string> property_files = 4;
99
100 // The required device state in order to install the package.
101 DeviceState precondition = 5;
102 // The expected device state after the update.
103 DeviceState postcondition = 6;
104
105 // True if the ota that updates a device to support dynamic partitions, where
106 // the source build doesn't support it.
107 bool retrofit_dynamic_partitions = 7;
108 // The required size of the cache partition, only valid for non-A/B update.
109 int64 required_cache = 8;
Kelvin Zhang05ff7052021-02-10 09:13:26 -0500110
111 // True iff security patch level downgrade is permitted on this OTA.
112 bool spl_downgrade = 9;
Tianjiea2076132020-08-19 17:25:32 -0700113}