1/*
2 * Copyright (C) 2017 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 aapt.pb;
20
21option java_package = "com.android.aapt";
22
23// A description of the requirements a device must have in order for a
24// resource to be matched and selected.
25message Configuration {
26  enum LayoutDirection {
27    LAYOUT_DIRECTION_UNSET = 0;
28    LAYOUT_DIRECTION_LTR = 1;
29    LAYOUT_DIRECTION_RTL = 2;
30  }
31
32  enum ScreenLayoutSize {
33    SCREEN_LAYOUT_SIZE_UNSET = 0;
34    SCREEN_LAYOUT_SIZE_SMALL = 1;
35    SCREEN_LAYOUT_SIZE_NORMAL = 2;
36    SCREEN_LAYOUT_SIZE_LARGE = 3;
37    SCREEN_LAYOUT_SIZE_XLARGE = 4;
38  }
39
40  enum ScreenLayoutLong {
41    SCREEN_LAYOUT_LONG_UNSET = 0;
42    SCREEN_LAYOUT_LONG_LONG = 1;
43    SCREEN_LAYOUT_LONG_NOTLONG = 2;
44  }
45
46  enum ScreenRound {
47    SCREEN_ROUND_UNSET = 0;
48    SCREEN_ROUND_ROUND = 1;
49    SCREEN_ROUND_NOTROUND = 2;
50  }
51
52  enum WideColorGamut {
53    WIDE_COLOR_GAMUT_UNSET = 0;
54    WIDE_COLOR_GAMUT_WIDECG = 1;
55    WIDE_COLOR_GAMUT_NOWIDECG = 2;
56  }
57
58  enum Hdr {
59    HDR_UNSET = 0;
60    HDR_HIGHDR = 1;
61    HDR_LOWDR = 2;
62  }
63
64  enum Orientation {
65    ORIENTATION_UNSET = 0;
66    ORIENTATION_PORT = 1;
67    ORIENTATION_LAND = 2;
68    ORIENTATION_SQUARE = 3;
69  }
70
71  enum UiModeType {
72    UI_MODE_TYPE_UNSET = 0;
73    UI_MODE_TYPE_NORMAL = 1;
74    UI_MODE_TYPE_DESK = 2;
75    UI_MODE_TYPE_CAR = 3;
76    UI_MODE_TYPE_TELEVISION = 4;
77    UI_MODE_TYPE_APPLIANCE = 5;
78    UI_MODE_TYPE_WATCH = 6;
79    UI_MODE_TYPE_VRHEADSET = 7;
80  }
81
82  enum UiModeNight {
83    UI_MODE_NIGHT_UNSET = 0;
84    UI_MODE_NIGHT_NIGHT = 1;
85    UI_MODE_NIGHT_NOTNIGHT = 2;
86  }
87
88  enum Touchscreen {
89    TOUCHSCREEN_UNSET = 0;
90    TOUCHSCREEN_NOTOUCH = 1;
91    TOUCHSCREEN_STYLUS = 2;
92    TOUCHSCREEN_FINGER = 3;
93  }
94
95  enum KeysHidden {
96    KEYS_HIDDEN_UNSET = 0;
97    KEYS_HIDDEN_KEYSEXPOSED = 1;
98    KEYS_HIDDEN_KEYSHIDDEN = 2;
99    KEYS_HIDDEN_KEYSSOFT = 3;
100  }
101
102  enum Keyboard {
103    KEYBOARD_UNSET = 0;
104    KEYBOARD_NOKEYS = 1;
105    KEYBOARD_QWERTY = 2;
106    KEYBOARD_TWELVEKEY = 3;
107  }
108
109  enum NavHidden {
110    NAV_HIDDEN_UNSET = 0;
111    NAV_HIDDEN_NAVEXPOSED = 1;
112    NAV_HIDDEN_NAVHIDDEN = 2;
113  }
114
115  enum Navigation {
116    NAVIGATION_UNSET = 0;
117    NAVIGATION_NONAV = 1;
118    NAVIGATION_DPAD = 2;
119    NAVIGATION_TRACKBALL = 3;
120    NAVIGATION_WHEEL = 4;
121  }
122
123  enum GrammaticalGender {
124    GRAM_GENDER_USET = 0;
125    GRAM_GENDER_NEUTER = 1;
126    GRAM_GENDER_FEMININE = 2;
127    GRAM_GENDER_MASCULINE = 3;
128  }
129
130  //
131  // Axis/dimensions that are understood by the runtime.
132  //
133
134  // Mobile country code.
135  uint32 mcc = 1;
136
137  // Mobile network code.
138  uint32 mnc = 2;
139
140  // BCP-47 locale tag.
141  string locale = 3;
142
143  // Left-to-right, right-to-left...
144  LayoutDirection layout_direction = 4;
145
146  // Screen width in pixels. Prefer screen_width_dp.
147  uint32 screen_width = 5;
148
149  // Screen height in pixels. Prefer screen_height_dp.
150  uint32 screen_height = 6;
151
152  // Screen width in density independent pixels (dp).
153  uint32 screen_width_dp = 7;
154
155  // Screen height in density independent pixels (dp).
156  uint32 screen_height_dp = 8;
157
158  // The smallest screen dimension, regardless of orientation, in dp.
159  uint32 smallest_screen_width_dp = 9;
160
161  // Whether the device screen is classified as small, normal, large, xlarge.
162  ScreenLayoutSize screen_layout_size = 10;
163
164  // Whether the device screen is long.
165  ScreenLayoutLong screen_layout_long = 11;
166
167  // Whether the screen is round (Android Wear).
168  ScreenRound screen_round = 12;
169
170  // Whether the screen supports wide color gamut.
171  WideColorGamut wide_color_gamut = 13;
172
173  // Whether the screen has high dynamic range.
174  Hdr hdr = 14;
175
176  // Which orientation the device is in (portrait, landscape).
177  Orientation orientation = 15;
178
179  // Which type of UI mode the device is in (television, car, etc.).
180  UiModeType ui_mode_type = 16;
181
182  // Whether the device is in night mode.
183  UiModeNight ui_mode_night = 17;
184
185  // The device's screen density in dots-per-inch (dpi).
186  uint32 density = 18;
187
188  // Whether a touchscreen exists, supports a stylus, or finger.
189  Touchscreen touchscreen = 19;
190
191  // Whether the keyboard hardware keys are currently hidden, exposed, or
192  // if the keyboard is a software keyboard.
193  KeysHidden keys_hidden = 20;
194
195  // The type of keyboard present (none, QWERTY, 12-key).
196  Keyboard keyboard = 21;
197
198  // Whether the navigation is exposed or hidden.
199  NavHidden nav_hidden = 22;
200
201  // The type of navigation present on the device
202  // (trackball, wheel, dpad, etc.).
203  Navigation navigation = 23;
204
205  // The minimum SDK version of the device.
206  uint32 sdk_version = 24;
207
208  // Grammatical gender.
209  GrammaticalGender grammatical_gender = 26;
210
211  //
212  // Build-time only dimensions.
213  //
214
215  string product = 25;
216}
217