• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  //
124  // Axis/dimensions that are understood by the runtime.
125  //
126
127  // Mobile country code.
128  uint32 mcc = 1;
129
130  // Mobile network code.
131  uint32 mnc = 2;
132
133  // BCP-47 locale tag.
134  string locale = 3;
135
136  // Left-to-right, right-to-left...
137  LayoutDirection layout_direction = 4;
138
139  // Screen width in pixels. Prefer screen_width_dp.
140  uint32 screen_width = 5;
141
142  // Screen height in pixels. Prefer screen_height_dp.
143  uint32 screen_height = 6;
144
145  // Screen width in density independent pixels (dp).
146  uint32 screen_width_dp = 7;
147
148  // Screen height in density independent pixels (dp).
149  uint32 screen_height_dp = 8;
150
151  // The smallest screen dimension, regardless of orientation, in dp.
152  uint32 smallest_screen_width_dp = 9;
153
154  // Whether the device screen is classified as small, normal, large, xlarge.
155  ScreenLayoutSize screen_layout_size = 10;
156
157  // Whether the device screen is long.
158  ScreenLayoutLong screen_layout_long = 11;
159
160  // Whether the screen is round (Android Wear).
161  ScreenRound screen_round = 12;
162
163  // Whether the screen supports wide color gamut.
164  WideColorGamut wide_color_gamut = 13;
165
166  // Whether the screen has high dynamic range.
167  Hdr hdr = 14;
168
169  // Which orientation the device is in (portrait, landscape).
170  Orientation orientation = 15;
171
172  // Which type of UI mode the device is in (television, car, etc.).
173  UiModeType ui_mode_type = 16;
174
175  // Whether the device is in night mode.
176  UiModeNight ui_mode_night = 17;
177
178  // The device's screen density in dots-per-inch (dpi).
179  uint32 density = 18;
180
181  // Whether a touchscreen exists, supports a stylus, or finger.
182  Touchscreen touchscreen = 19;
183
184  // Whether the keyboard hardware keys are currently hidden, exposed, or
185  // if the keyboard is a software keyboard.
186  KeysHidden keys_hidden = 20;
187
188  // The type of keyboard present (none, QWERTY, 12-key).
189  Keyboard keyboard = 21;
190
191  // Whether the navigation is exposed or hidden.
192  NavHidden nav_hidden = 22;
193
194  // The type of navigation present on the device
195  // (trackball, wheel, dpad, etc.).
196  Navigation navigation = 23;
197
198  // The minimum SDK version of the device.
199  uint32 sdk_version = 24;
200
201  //
202  // Build-time only dimensions.
203  //
204
205  string product = 25;
206}
207