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