File: targeting.proto

package info (click to toggle)
golang-android-soong 0.0~git20201014.17e97d9-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 7,680 kB
  • sloc: python: 3,000; sh: 1,780; cpp: 66; makefile: 5
file content (232 lines) | stat: -rw-r--r-- 6,241 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
// Messages describing APK Set's table of contents (toc.pb entry).
// Please be advised that the ultimate source is at
// https://github.com/google/bundletool/tree/master/src/main/proto
// so you have been warned.
syntax = "proto3";

package android.bundle;

option go_package = "android_bundle_proto";
option java_package = "com.android.bundle";

// Targeting on the level of variants.
message VariantTargeting {
  SdkVersionTargeting sdk_version_targeting = 1;
  AbiTargeting abi_targeting = 2;
  ScreenDensityTargeting screen_density_targeting = 3;
  MultiAbiTargeting multi_abi_targeting = 4;
  TextureCompressionFormatTargeting texture_compression_format_targeting = 5;
}

// Targeting on the level of individual APKs.
message ApkTargeting {
  AbiTargeting abi_targeting = 1;
  GraphicsApiTargeting graphics_api_targeting = 2;
  LanguageTargeting language_targeting = 3;
  ScreenDensityTargeting screen_density_targeting = 4;
  SdkVersionTargeting sdk_version_targeting = 5;
  TextureCompressionFormatTargeting texture_compression_format_targeting = 6;
  MultiAbiTargeting multi_abi_targeting = 7;
  SanitizerTargeting sanitizer_targeting = 8;
}

// Targeting on the module level.
// The semantic of the targeting is the "AND" rule on all immediate values.
message ModuleTargeting {
  SdkVersionTargeting sdk_version_targeting = 1;
  repeated DeviceFeatureTargeting device_feature_targeting = 2;
  UserCountriesTargeting user_countries_targeting = 3;
}

// User Countries targeting describing an inclusive/exclusive list of country
// codes that module targets.
message UserCountriesTargeting {
  // List of country codes in the two-letter CLDR territory format.
  repeated string country_codes = 1;

  // Indicates if the list above is exclusive.
  bool exclude = 2;
}

message ScreenDensity {
  enum DensityAlias {
    DENSITY_UNSPECIFIED = 0;
    NODPI = 1;
    LDPI = 2;
    MDPI = 3;
    TVDPI = 4;
    HDPI = 5;
    XHDPI = 6;
    XXHDPI = 7;
    XXXHDPI = 8;
  }

  oneof density_oneof {
    DensityAlias density_alias = 1;
    int32 density_dpi = 2;
  }
}

// Wrapper message for `int32`.
//
// The JSON representation for `Int32Value` is JSON number.
message Int32Value {
  // The int32 value.
  int32 value = 1;
}

message SdkVersion {
  // Inclusive.
  Int32Value min = 1;
}

message GraphicsApi {
  oneof api_oneof {
    // Inclusive.
    OpenGlVersion min_open_gl_version = 1;
    // Inclusive.
    VulkanVersion min_vulkan_version = 2;
  }
}

message VulkanVersion {
  int32 major = 1;  // VK_VERSION_MAJOR
  int32 minor = 2;  // VK_VERSION_MINOR
}

message OpenGlVersion {
  // e.g. OpenGL ES 3.2 is represented as { major: 3, minor: 2 }
  int32 major = 1;  // GL_MAJOR_VERSION
  int32 minor = 2;  // GL_MINOR_VERSION
}

message TextureCompressionFormat {
  enum TextureCompressionFormatAlias {
    UNSPECIFIED_TEXTURE_COMPRESSION_FORMAT = 0;
    ETC1_RGB8 = 1;
    PALETTED = 2;
    THREE_DC = 3;
    ATC = 4;
    LATC = 5;
    DXT1 = 6;
    S3TC = 7;
    PVRTC = 8;
    ASTC = 9;
    ETC2 = 10;
  }
  TextureCompressionFormatAlias alias = 1;
}

message Abi {
  enum AbiAlias {
    UNSPECIFIED_CPU_ARCHITECTURE = 0;
    ARMEABI = 1;
    ARMEABI_V7A = 2;
    ARM64_V8A = 3;
    X86 = 4;
    X86_64 = 5;
    MIPS = 6;
    MIPS64 = 7;
  }
  AbiAlias alias = 1;
}

message MultiAbi {
  repeated Abi abi = 1;
}

message Sanitizer {
  enum SanitizerAlias {
    NONE = 0;
    HWADDRESS = 1;
  }
  SanitizerAlias alias = 1;
}

message DeviceFeature {
  string feature_name = 1;
  // Equivalent of android:glEsVersion or android:version in <uses-feature>.
  int32 feature_version = 2;
}

// Targeting specific for directories under assets/.
message AssetsDirectoryTargeting {
  AbiTargeting abi = 1;
  GraphicsApiTargeting graphics_api = 2;
  TextureCompressionFormatTargeting texture_compression_format = 3;
  LanguageTargeting language = 4;
}

// Targeting specific for directories under lib/.
message NativeDirectoryTargeting {
  Abi abi = 1;
  GraphicsApi graphics_api = 2;
  TextureCompressionFormat texture_compression_format = 3;
  Sanitizer sanitizer = 4;
}

// Targeting specific for image files under apex/.
message ApexImageTargeting {
  MultiAbiTargeting multi_abi = 1;
}

message AbiTargeting {
  repeated Abi value = 1;
  // Targeting of other sibling directories that were in the Bundle.
  // For master splits this is targeting of other master splits.
  repeated Abi alternatives = 2;
}

message MultiAbiTargeting {
  repeated MultiAbi value = 1;
  // Targeting of other sibling directories that were in the Bundle.
  // For master splits this is targeting of other master splits.
  repeated MultiAbi alternatives = 2;
}

message ScreenDensityTargeting {
  repeated ScreenDensity value = 1;
  // Targeting of other sibling directories that were in the Bundle.
  // For master splits this is targeting of other master splits.
  repeated ScreenDensity alternatives = 2;
}

message LanguageTargeting {
  // ISO-639: 2 or 3 letter language code.
  repeated string value = 1;
  // Targeting of other sibling directories that were in the Bundle.
  // For master splits this is targeting of other master splits.
  repeated string alternatives = 2;
}

message GraphicsApiTargeting {
  repeated GraphicsApi value = 1;
  // Targeting of other sibling directories that were in the Bundle.
  // For master splits this is targeting of other master splits.
  repeated GraphicsApi alternatives = 2;
}

message SdkVersionTargeting {
  repeated SdkVersion value = 1;
  // Targeting of other sibling directories that were in the Bundle.
  // For master splits this is targeting of other master splits.
  repeated SdkVersion alternatives = 2;
}

message TextureCompressionFormatTargeting {
  repeated TextureCompressionFormat value = 1;
  // Targeting of other sibling directories that were in the Bundle.
  // For master splits this is targeting of other master splits.
  repeated TextureCompressionFormat alternatives = 2;
}

message SanitizerTargeting {
  repeated Sanitizer value = 1;
}

// Since other atom targeting messages have the "OR" semantic on values
// the DeviceFeatureTargeting represents only one device feature to retain
// that convention.
message DeviceFeatureTargeting {
  DeviceFeature required_feature = 1;
}