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