blob: c7f920ac6c58173627ab7fdf974f8d63198fa3bc [file] [log] [blame]
Adam Lesinski6f6ceb72014-11-14 14:48:12 -08001/*
2 * Copyright (C) 2015 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
Adam Lesinski75f3a552015-06-03 14:54:23 -070017#include "SdkConstants.h"
18
19#include <algorithm>
Adam Lesinski6f6ceb72014-11-14 14:48:12 -080020#include <string>
21#include <unordered_map>
Adam Lesinski75f3a552015-06-03 14:54:23 -070022#include <vector>
Adam Lesinski6f6ceb72014-11-14 14:48:12 -080023
24namespace aapt {
25
Adam Lesinskid0f116b2016-07-08 15:00:32 -070026static const char* sDevelopmentSdkCodeName = "O";
Adam Lesinskifb6312f2016-06-28 14:40:32 -070027static int sDevelopmentSdkLevel = 26;
28
Adam Lesinski75f3a552015-06-03 14:54:23 -070029static const std::vector<std::pair<uint16_t, size_t>> sAttrIdMap = {
Adam Lesinskicacb28f2016-10-19 12:18:14 -070030 {0x021c, 1},
31 {0x021d, 2},
32 {0x0269, SDK_CUPCAKE},
33 {0x028d, SDK_DONUT},
34 {0x02ad, SDK_ECLAIR},
35 {0x02b3, SDK_ECLAIR_0_1},
36 {0x02b5, SDK_ECLAIR_MR1},
37 {0x02bd, SDK_FROYO},
38 {0x02cb, SDK_GINGERBREAD},
39 {0x0361, SDK_HONEYCOMB},
40 {0x0363, SDK_HONEYCOMB_MR1},
41 {0x0366, SDK_HONEYCOMB_MR2},
42 {0x03a6, SDK_ICE_CREAM_SANDWICH},
43 {0x03ae, SDK_JELLY_BEAN},
44 {0x03cc, SDK_JELLY_BEAN_MR1},
45 {0x03da, SDK_JELLY_BEAN_MR2},
46 {0x03f1, SDK_KITKAT},
47 {0x03f6, SDK_KITKAT_WATCH},
48 {0x04ce, SDK_LOLLIPOP},
Adam Lesinski75f3a552015-06-03 14:54:23 -070049};
50
Adam Lesinskice5e56e2016-10-21 17:56:45 -070051static bool less_entry_id(const std::pair<uint16_t, size_t>& p,
Adam Lesinskicacb28f2016-10-19 12:18:14 -070052 uint16_t entryId) {
53 return p.first < entryId;
Adam Lesinski75f3a552015-06-03 14:54:23 -070054}
55
Adam Lesinskice5e56e2016-10-21 17:56:45 -070056size_t FindAttributeSdkLevel(const ResourceId& id) {
57 if (id.package_id() != 0x01 && id.type_id() != 0x01) {
Adam Lesinskicacb28f2016-10-19 12:18:14 -070058 return 0;
59 }
60 auto iter = std::lower_bound(sAttrIdMap.begin(), sAttrIdMap.end(),
Adam Lesinskice5e56e2016-10-21 17:56:45 -070061 id.entry_id(), less_entry_id);
Adam Lesinskicacb28f2016-10-19 12:18:14 -070062 if (iter == sAttrIdMap.end()) {
63 return SDK_LOLLIPOP_MR1;
64 }
65 return iter->second;
Adam Lesinski75f3a552015-06-03 14:54:23 -070066}
67
Adam Lesinskid0f116b2016-07-08 15:00:32 -070068static const std::unordered_map<std::string, size_t> sAttrMap = {
Adam Lesinskicacb28f2016-10-19 12:18:14 -070069 {"marqueeRepeatLimit", 2},
70 {"windowNoDisplay", 3},
71 {"backgroundDimEnabled", 3},
72 {"inputType", 3},
73 {"isDefault", 3},
74 {"windowDisablePreview", 3},
75 {"privateImeOptions", 3},
76 {"editorExtras", 3},
77 {"settingsActivity", 3},
78 {"fastScrollEnabled", 3},
79 {"reqTouchScreen", 3},
80 {"reqKeyboardType", 3},
81 {"reqHardKeyboard", 3},
82 {"reqNavigation", 3},
83 {"windowSoftInputMode", 3},
84 {"imeFullscreenBackground", 3},
85 {"noHistory", 3},
86 {"headerDividersEnabled", 3},
87 {"footerDividersEnabled", 3},
88 {"candidatesTextStyleSpans", 3},
89 {"smoothScrollbar", 3},
90 {"reqFiveWayNav", 3},
91 {"keyBackground", 3},
92 {"keyTextSize", 3},
93 {"labelTextSize", 3},
94 {"keyTextColor", 3},
95 {"keyPreviewLayout", 3},
96 {"keyPreviewOffset", 3},
97 {"keyPreviewHeight", 3},
98 {"verticalCorrection", 3},
99 {"popupLayout", 3},
100 {"state_long_pressable", 3},
101 {"keyWidth", 3},
102 {"keyHeight", 3},
103 {"horizontalGap", 3},
104 {"verticalGap", 3},
105 {"rowEdgeFlags", 3},
106 {"codes", 3},
107 {"popupKeyboard", 3},
108 {"popupCharacters", 3},
109 {"keyEdgeFlags", 3},
110 {"isModifier", 3},
111 {"isSticky", 3},
112 {"isRepeatable", 3},
113 {"iconPreview", 3},
114 {"keyOutputText", 3},
115 {"keyLabel", 3},
116 {"keyIcon", 3},
117 {"keyboardMode", 3},
118 {"isScrollContainer", 3},
119 {"fillEnabled", 3},
120 {"updatePeriodMillis", 3},
121 {"initialLayout", 3},
122 {"voiceSearchMode", 3},
123 {"voiceLanguageModel", 3},
124 {"voicePromptText", 3},
125 {"voiceLanguage", 3},
126 {"voiceMaxResults", 3},
127 {"bottomOffset", 3},
128 {"topOffset", 3},
129 {"allowSingleTap", 3},
130 {"handle", 3},
131 {"content", 3},
132 {"animateOnClick", 3},
133 {"configure", 3},
134 {"hapticFeedbackEnabled", 3},
135 {"innerRadius", 3},
136 {"thickness", 3},
137 {"sharedUserLabel", 3},
138 {"dropDownWidth", 3},
139 {"dropDownAnchor", 3},
140 {"imeOptions", 3},
141 {"imeActionLabel", 3},
142 {"imeActionId", 3},
143 {"imeExtractEnterAnimation", 3},
144 {"imeExtractExitAnimation", 3},
145 {"tension", 4},
146 {"extraTension", 4},
147 {"anyDensity", 4},
148 {"searchSuggestThreshold", 4},
149 {"includeInGlobalSearch", 4},
150 {"onClick", 4},
151 {"targetSdkVersion", 4},
152 {"maxSdkVersion", 4},
153 {"testOnly", 4},
154 {"contentDescription", 4},
155 {"gestureStrokeWidth", 4},
156 {"gestureColor", 4},
157 {"uncertainGestureColor", 4},
158 {"fadeOffset", 4},
159 {"fadeDuration", 4},
160 {"gestureStrokeType", 4},
161 {"gestureStrokeLengthThreshold", 4},
162 {"gestureStrokeSquarenessThreshold", 4},
163 {"gestureStrokeAngleThreshold", 4},
164 {"eventsInterceptionEnabled", 4},
165 {"fadeEnabled", 4},
166 {"backupAgent", 4},
167 {"allowBackup", 4},
168 {"glEsVersion", 4},
169 {"queryAfterZeroResults", 4},
170 {"dropDownHeight", 4},
171 {"smallScreens", 4},
172 {"normalScreens", 4},
173 {"largeScreens", 4},
174 {"progressBarStyleInverse", 4},
175 {"progressBarStyleSmallInverse", 4},
176 {"progressBarStyleLargeInverse", 4},
177 {"searchSettingsDescription", 4},
178 {"textColorPrimaryInverseDisableOnly", 4},
179 {"autoUrlDetect", 4},
180 {"resizeable", 4},
181 {"required", 5},
182 {"accountType", 5},
183 {"contentAuthority", 5},
184 {"userVisible", 5},
185 {"windowShowWallpaper", 5},
186 {"wallpaperOpenEnterAnimation", 5},
187 {"wallpaperOpenExitAnimation", 5},
188 {"wallpaperCloseEnterAnimation", 5},
189 {"wallpaperCloseExitAnimation", 5},
190 {"wallpaperIntraOpenEnterAnimation", 5},
191 {"wallpaperIntraOpenExitAnimation", 5},
192 {"wallpaperIntraCloseEnterAnimation", 5},
193 {"wallpaperIntraCloseExitAnimation", 5},
194 {"supportsUploading", 5},
195 {"killAfterRestore", 5},
196 {"restoreNeedsApplication", 5},
197 {"smallIcon", 5},
198 {"accountPreferences", 5},
199 {"textAppearanceSearchResultSubtitle", 5},
200 {"textAppearanceSearchResultTitle", 5},
201 {"summaryColumn", 5},
202 {"detailColumn", 5},
203 {"detailSocialSummary", 5},
204 {"thumbnail", 5},
205 {"detachWallpaper", 5},
206 {"finishOnCloseSystemDialogs", 5},
207 {"scrollbarFadeDuration", 5},
208 {"scrollbarDefaultDelayBeforeFade", 5},
209 {"fadeScrollbars", 5},
210 {"colorBackgroundCacheHint", 5},
211 {"dropDownHorizontalOffset", 5},
212 {"dropDownVerticalOffset", 5},
213 {"quickContactBadgeStyleWindowSmall", 6},
214 {"quickContactBadgeStyleWindowMedium", 6},
215 {"quickContactBadgeStyleWindowLarge", 6},
216 {"quickContactBadgeStyleSmallWindowSmall", 6},
217 {"quickContactBadgeStyleSmallWindowMedium", 6},
218 {"quickContactBadgeStyleSmallWindowLarge", 6},
219 {"author", 7},
220 {"autoStart", 7},
221 {"expandableListViewWhiteStyle", 8},
222 {"installLocation", 8},
223 {"vmSafeMode", 8},
224 {"webTextViewStyle", 8},
225 {"restoreAnyVersion", 8},
226 {"tabStripLeft", 8},
227 {"tabStripRight", 8},
228 {"tabStripEnabled", 8},
229 {"logo", 9},
230 {"xlargeScreens", 9},
231 {"immersive", 9},
232 {"overScrollMode", 9},
233 {"overScrollHeader", 9},
234 {"overScrollFooter", 9},
235 {"filterTouchesWhenObscured", 9},
236 {"textSelectHandleLeft", 9},
237 {"textSelectHandleRight", 9},
238 {"textSelectHandle", 9},
239 {"textSelectHandleWindowStyle", 9},
240 {"popupAnimationStyle", 9},
241 {"screenSize", 9},
242 {"screenDensity", 9},
243 {"allContactsName", 11},
244 {"windowActionBar", 11},
245 {"actionBarStyle", 11},
246 {"navigationMode", 11},
247 {"displayOptions", 11},
248 {"subtitle", 11},
249 {"customNavigationLayout", 11},
250 {"hardwareAccelerated", 11},
251 {"measureWithLargestChild", 11},
252 {"animateFirstView", 11},
253 {"dropDownSpinnerStyle", 11},
254 {"actionDropDownStyle", 11},
255 {"actionButtonStyle", 11},
256 {"showAsAction", 11},
257 {"previewImage", 11},
258 {"actionModeBackground", 11},
259 {"actionModeCloseDrawable", 11},
260 {"windowActionModeOverlay", 11},
261 {"valueFrom", 11},
262 {"valueTo", 11},
263 {"valueType", 11},
264 {"propertyName", 11},
265 {"ordering", 11},
266 {"fragment", 11},
267 {"windowActionBarOverlay", 11},
268 {"fragmentOpenEnterAnimation", 11},
269 {"fragmentOpenExitAnimation", 11},
270 {"fragmentCloseEnterAnimation", 11},
271 {"fragmentCloseExitAnimation", 11},
272 {"fragmentFadeEnterAnimation", 11},
273 {"fragmentFadeExitAnimation", 11},
274 {"actionBarSize", 11},
275 {"imeSubtypeLocale", 11},
276 {"imeSubtypeMode", 11},
277 {"imeSubtypeExtraValue", 11},
278 {"splitMotionEvents", 11},
279 {"listChoiceBackgroundIndicator", 11},
280 {"spinnerMode", 11},
281 {"animateLayoutChanges", 11},
282 {"actionBarTabStyle", 11},
283 {"actionBarTabBarStyle", 11},
284 {"actionBarTabTextStyle", 11},
285 {"actionOverflowButtonStyle", 11},
286 {"actionModeCloseButtonStyle", 11},
287 {"titleTextStyle", 11},
288 {"subtitleTextStyle", 11},
289 {"iconifiedByDefault", 11},
290 {"actionLayout", 11},
291 {"actionViewClass", 11},
292 {"activatedBackgroundIndicator", 11},
293 {"state_activated", 11},
294 {"listPopupWindowStyle", 11},
295 {"popupMenuStyle", 11},
296 {"textAppearanceLargePopupMen", 11},
297 {"textAppearanceSmallPopupMen", 11},
298 {"breadCrumbTitle", 11},
299 {"breadCrumbShortTitle", 11},
300 {"listDividerAlertDialog", 11},
301 {"textColorAlertDialogListItem", 11},
302 {"loopViews", 11},
303 {"dialogTheme", 11},
304 {"alertDialogTheme", 11},
305 {"dividerVertical", 11},
306 {"homeAsUpIndicator", 11},
307 {"enterFadeDuration", 11},
308 {"exitFadeDuration", 11},
309 {"selectableItemBackground", 11},
310 {"autoAdvanceViewId", 11},
311 {"useIntrinsicSizeAsMinimum", 11},
312 {"actionModeCutDrawable", 11},
313 {"actionModeCopyDrawable", 11},
314 {"actionModePasteDrawable", 11},
315 {"textEditPasteWindowLayout", 11},
316 {"textEditNoPasteWindowLayout", 11},
317 {"textIsSelectable", 11},
318 {"windowEnableSplitTouch", 11},
319 {"indeterminateProgressStyle", 11},
320 {"progressBarPadding", 11},
321 {"animationResolution", 11},
322 {"state_accelerated", 11},
323 {"baseline", 11},
324 {"homeLayout", 11},
325 {"opacity", 11},
326 {"alpha", 11},
327 {"transformPivotX", 11},
328 {"transformPivotY", 11},
329 {"translationX", 11},
330 {"translationY", 11},
331 {"scaleX", 11},
332 {"scaleY", 11},
333 {"rotation", 11},
334 {"rotationX", 11},
335 {"rotationY", 11},
336 {"showDividers", 11},
337 {"dividerPadding", 11},
338 {"borderlessButtonStyle", 11},
339 {"dividerHorizontal", 11},
340 {"itemPadding", 11},
341 {"buttonBarStyle", 11},
342 {"buttonBarButtonStyle", 11},
343 {"segmentedButtonStyle", 11},
344 {"staticWallpaperPreview", 11},
345 {"allowParallelSyncs", 11},
346 {"isAlwaysSyncable", 11},
347 {"verticalScrollbarPosition", 11},
348 {"fastScrollAlwaysVisible", 11},
349 {"fastScrollThumbDrawable", 11},
350 {"fastScrollPreviewBackgroundLeft", 11},
351 {"fastScrollPreviewBackgroundRight", 11},
352 {"fastScrollTrackDrawable", 11},
353 {"fastScrollOverlayPosition", 11},
354 {"customTokens", 11},
355 {"nextFocusForward", 11},
356 {"firstDayOfWeek", 11},
357 {"showWeekNumber", 11},
358 {"minDate", 11},
359 {"maxDate", 11},
360 {"shownWeekCount", 11},
361 {"selectedWeekBackgroundColor", 11},
362 {"focusedMonthDateColor", 11},
363 {"unfocusedMonthDateColor", 11},
364 {"weekNumberColor", 11},
365 {"weekSeparatorLineColor", 11},
366 {"selectedDateVerticalBar", 11},
367 {"weekDayTextAppearance", 11},
368 {"dateTextAppearance", 11},
369 {"solidColor", 11},
370 {"spinnersShown", 11},
371 {"calendarViewShown", 11},
372 {"state_multiline", 11},
373 {"detailsElementBackground", 11},
374 {"textColorHighlightInverse", 11},
375 {"textColorLinkInverse", 11},
376 {"editTextColor", 11},
377 {"editTextBackground", 11},
378 {"horizontalScrollViewStyle", 11},
379 {"layerType", 11},
380 {"alertDialogIcon", 11},
381 {"windowMinWidthMajor", 11},
382 {"windowMinWidthMinor", 11},
383 {"queryHint", 11},
384 {"fastScrollTextColor", 11},
385 {"largeHeap", 11},
386 {"windowCloseOnTouchOutside", 11},
387 {"datePickerStyle", 11},
388 {"calendarViewStyle", 11},
389 {"textEditSidePasteWindowLayout", 11},
390 {"textEditSideNoPasteWindowLayout", 11},
391 {"actionMenuTextAppearance", 11},
392 {"actionMenuTextColor", 11},
393 {"textCursorDrawable", 12},
394 {"resizeMode", 12},
395 {"requiresSmallestWidthDp", 12},
396 {"compatibleWidthLimitDp", 12},
397 {"largestWidthLimitDp", 12},
398 {"state_hovered", 13},
399 {"state_drag_can_accept", 13},
400 {"state_drag_hovered", 13},
401 {"stopWithTask", 13},
402 {"switchTextOn", 13},
403 {"switchTextOff", 13},
404 {"switchPreferenceStyle", 13},
405 {"switchTextAppearance", 13},
406 {"track", 13},
407 {"switchMinWidth", 13},
408 {"switchPadding", 13},
409 {"thumbTextPadding", 13},
410 {"textSuggestionsWindowStyle", 13},
411 {"textEditSuggestionItemLayout", 13},
412 {"rowCount", 13},
413 {"rowOrderPreserved", 13},
414 {"columnCount", 13},
415 {"columnOrderPreserved", 13},
416 {"useDefaultMargins", 13},
417 {"alignmentMode", 13},
418 {"layout_row", 13},
419 {"layout_rowSpan", 13},
420 {"layout_columnSpan", 13},
421 {"actionModeSelectAllDrawable", 13},
422 {"isAuxiliary", 13},
423 {"accessibilityEventTypes", 13},
424 {"packageNames", 13},
425 {"accessibilityFeedbackType", 13},
426 {"notificationTimeout", 13},
427 {"accessibilityFlags", 13},
428 {"canRetrieveWindowContent", 13},
429 {"listPreferredItemHeightLarge", 13},
430 {"listPreferredItemHeightSmall", 13},
431 {"actionBarSplitStyle", 13},
432 {"actionProviderClass", 13},
433 {"backgroundStacked", 13},
434 {"backgroundSplit", 13},
435 {"textAllCaps", 13},
436 {"colorPressedHighlight", 13},
437 {"colorLongPressedHighlight", 13},
438 {"colorFocusedHighlight", 13},
439 {"colorActivatedHighlight", 13},
440 {"colorMultiSelectHighlight", 13},
441 {"drawableStart", 13},
442 {"drawableEnd", 13},
443 {"actionModeStyle", 13},
444 {"minResizeWidth", 13},
445 {"minResizeHeight", 13},
446 {"actionBarWidgetTheme", 13},
447 {"uiOptions", 13},
448 {"subtypeLocale", 13},
449 {"subtypeExtraValue", 13},
450 {"actionBarDivider", 13},
451 {"actionBarItemBackground", 13},
452 {"actionModeSplitBackground", 13},
453 {"textAppearanceListItem", 13},
454 {"textAppearanceListItemSmall", 13},
455 {"targetDescriptions", 13},
456 {"directionDescriptions", 13},
457 {"overridesImplicitlyEnabledSubtype", 13},
458 {"listPreferredItemPaddingLeft", 13},
459 {"listPreferredItemPaddingRight", 13},
460 {"requiresFadingEdge", 13},
461 {"publicKey", 13},
462 {"parentActivityName", 16},
463 {"isolatedProcess", 16},
464 {"importantForAccessibility", 16},
465 {"keyboardLayout", 16},
466 {"fontFamily", 16},
467 {"mediaRouteButtonStyle", 16},
468 {"mediaRouteTypes", 16},
469 {"supportsRtl", 17},
470 {"textDirection", 17},
471 {"textAlignment", 17},
472 {"layoutDirection", 17},
473 {"paddingStart", 17},
474 {"paddingEnd", 17},
475 {"layout_marginStart", 17},
476 {"layout_marginEnd", 17},
477 {"layout_toStartOf", 17},
478 {"layout_toEndOf", 17},
479 {"layout_alignStart", 17},
480 {"layout_alignEnd", 17},
481 {"layout_alignParentStart", 17},
482 {"layout_alignParentEnd", 17},
483 {"listPreferredItemPaddingStart", 17},
484 {"listPreferredItemPaddingEnd", 17},
485 {"singleUser", 17},
486 {"presentationTheme", 17},
487 {"subtypeId", 17},
488 {"initialKeyguardLayout", 17},
489 {"widgetCategory", 17},
490 {"permissionGroupFlags", 17},
491 {"labelFor", 17},
492 {"permissionFlags", 17},
493 {"checkedTextViewStyle", 17},
494 {"showOnLockScreen", 17},
495 {"format12Hour", 17},
496 {"format24Hour", 17},
497 {"timeZone", 17},
498 {"mipMap", 18},
499 {"mirrorForRtl", 18},
500 {"windowOverscan", 18},
501 {"requiredForAllUsers", 18},
502 {"indicatorStart", 18},
503 {"indicatorEnd", 18},
504 {"childIndicatorStart", 18},
505 {"childIndicatorEnd", 18},
506 {"restrictedAccountType", 18},
507 {"requiredAccountType", 18},
508 {"canRequestTouchExplorationMode", 18},
509 {"canRequestEnhancedWebAccessibility", 18},
510 {"canRequestFilterKeyEvents", 18},
511 {"layoutMode", 18},
512 {"keySet", 19},
513 {"targetId", 19},
514 {"fromScene", 19},
515 {"toScene", 19},
516 {"transition", 19},
517 {"transitionOrdering", 19},
518 {"fadingMode", 19},
519 {"startDelay", 19},
520 {"ssp", 19},
521 {"sspPrefix", 19},
522 {"sspPattern", 19},
523 {"addPrintersActivity", 19},
524 {"vendor", 19},
525 {"category", 19},
526 {"isAsciiCapable", 19},
527 {"autoMirrored", 19},
528 {"supportsSwitchingToNextInputMethod", 19},
529 {"requireDeviceUnlock", 19},
530 {"apduServiceBanner", 19},
531 {"accessibilityLiveRegion", 19},
532 {"windowTranslucentStatus", 19},
533 {"windowTranslucentNavigation", 19},
534 {"advancedPrintOptionsActivity", 19},
535 {"banner", 20},
536 {"windowSwipeToDismiss", 20},
537 {"isGame", 20},
538 {"allowEmbedded", 20},
539 {"setupActivity", 20},
540 {"fastScrollStyle", 21},
541 {"windowContentTransitions", 21},
542 {"windowContentTransitionManager", 21},
543 {"translationZ", 21},
544 {"tintMode", 21},
545 {"controlX1", 21},
546 {"controlY1", 21},
547 {"controlX2", 21},
548 {"controlY2", 21},
549 {"transitionName", 21},
550 {"transitionGroup", 21},
551 {"viewportWidth", 21},
552 {"viewportHeight", 21},
553 {"fillColor", 21},
554 {"pathData", 21},
555 {"strokeColor", 21},
556 {"strokeWidth", 21},
557 {"trimPathStart", 21},
558 {"trimPathEnd", 21},
559 {"trimPathOffset", 21},
560 {"strokeLineCap", 21},
561 {"strokeLineJoin", 21},
562 {"strokeMiterLimit", 21},
563 {"colorControlNormal", 21},
564 {"colorControlActivated", 21},
565 {"colorButtonNormal", 21},
566 {"colorControlHighlight", 21},
567 {"persistableMode", 21},
568 {"titleTextAppearance", 21},
569 {"subtitleTextAppearance", 21},
570 {"slideEdge", 21},
571 {"actionBarTheme", 21},
572 {"textAppearanceListItemSecondary", 21},
573 {"colorPrimary", 21},
574 {"colorPrimaryDark", 21},
575 {"colorAccent", 21},
576 {"nestedScrollingEnabled", 21},
577 {"windowEnterTransition", 21},
578 {"windowExitTransition", 21},
579 {"windowSharedElementEnterTransition", 21},
580 {"windowSharedElementExitTransition", 21},
581 {"windowAllowReturnTransitionOverlap", 21},
582 {"windowAllowEnterTransitionOverlap", 21},
583 {"sessionService", 21},
584 {"stackViewStyle", 21},
585 {"switchStyle", 21},
586 {"elevation", 21},
587 {"excludeId", 21},
588 {"excludeClass", 21},
589 {"hideOnContentScroll", 21},
590 {"actionOverflowMenuStyle", 21},
591 {"documentLaunchMode", 21},
592 {"maxRecents", 21},
593 {"autoRemoveFromRecents", 21},
594 {"stateListAnimator", 21},
595 {"toId", 21},
596 {"fromId", 21},
597 {"reversible", 21},
598 {"splitTrack", 21},
599 {"targetName", 21},
600 {"excludeName", 21},
601 {"matchOrder", 21},
602 {"windowDrawsSystemBarBackgrounds", 21},
603 {"statusBarColor", 21},
604 {"navigationBarColor", 21},
605 {"contentInsetStart", 21},
606 {"contentInsetEnd", 21},
607 {"contentInsetLeft", 21},
608 {"contentInsetRight", 21},
609 {"paddingMode", 21},
610 {"layout_rowWeight", 21},
611 {"layout_columnWeight", 21},
612 {"translateX", 21},
613 {"translateY", 21},
614 {"selectableItemBackgroundBorderless", 21},
615 {"elegantTextHeight", 21},
616 {"searchKeyphraseId", 21},
617 {"searchKeyphrase", 21},
618 {"searchKeyphraseSupportedLocales", 21},
619 {"windowTransitionBackgroundFadeDuration", 21},
620 {"overlapAnchor", 21},
621 {"progressTint", 21},
622 {"progressTintMode", 21},
623 {"progressBackgroundTint", 21},
624 {"progressBackgroundTintMode", 21},
625 {"secondaryProgressTint", 21},
626 {"secondaryProgressTintMode", 21},
627 {"indeterminateTint", 21},
628 {"indeterminateTintMode", 21},
629 {"backgroundTint", 21},
630 {"backgroundTintMode", 21},
631 {"foregroundTint", 21},
632 {"foregroundTintMode", 21},
633 {"buttonTint", 21},
634 {"buttonTintMode", 21},
635 {"thumbTint", 21},
636 {"thumbTintMode", 21},
637 {"fullBackupOnly", 21},
638 {"propertyXName", 21},
639 {"propertyYName", 21},
640 {"relinquishTaskIdentity", 21},
641 {"tileModeX", 21},
642 {"tileModeY", 21},
643 {"actionModeShareDrawable", 21},
644 {"actionModeFindDrawable", 21},
645 {"actionModeWebSearchDrawable", 21},
646 {"transitionVisibilityMode", 21},
647 {"minimumHorizontalAngle", 21},
648 {"minimumVerticalAngle", 21},
649 {"maximumAngle", 21},
650 {"searchViewStyle", 21},
651 {"closeIcon", 21},
652 {"goIcon", 21},
653 {"searchIcon", 21},
654 {"voiceIcon", 21},
655 {"commitIcon", 21},
656 {"suggestionRowLayout", 21},
657 {"queryBackground", 21},
658 {"submitBackground", 21},
659 {"buttonBarPositiveButtonStyle", 21},
660 {"buttonBarNeutralButtonStyle", 21},
661 {"buttonBarNegativeButtonStyle", 21},
662 {"popupElevation", 21},
663 {"actionBarPopupTheme", 21},
664 {"multiArch", 21},
665 {"touchscreenBlocksFocus", 21},
666 {"windowElevation", 21},
667 {"launchTaskBehindTargetAnimation", 21},
668 {"launchTaskBehindSourceAnimation", 21},
669 {"restrictionType", 21},
670 {"dayOfWeekBackground", 21},
671 {"dayOfWeekTextAppearance", 21},
672 {"headerMonthTextAppearance", 21},
673 {"headerDayOfMonthTextAppearance", 21},
674 {"headerYearTextAppearance", 21},
675 {"yearListItemTextAppearance", 21},
676 {"yearListSelectorColor", 21},
677 {"calendarTextColor", 21},
678 {"recognitionService", 21},
679 {"timePickerStyle", 21},
680 {"timePickerDialogTheme", 21},
681 {"headerTimeTextAppearance", 21},
682 {"headerAmPmTextAppearance", 21},
683 {"numbersTextColor", 21},
684 {"numbersBackgroundColor", 21},
685 {"numbersSelectorColor", 21},
686 {"amPmTextColor", 21},
687 {"amPmBackgroundColor", 21},
688 {"searchKeyphraseRecognitionFlags", 21},
689 {"checkMarkTint", 21},
690 {"checkMarkTintMode", 21},
691 {"popupTheme", 21},
692 {"toolbarStyle", 21},
693 {"windowClipToOutline", 21},
694 {"datePickerDialogTheme", 21},
695 {"showText", 21},
696 {"windowReturnTransition", 21},
697 {"windowReenterTransition", 21},
698 {"windowSharedElementReturnTransition", 21},
699 {"windowSharedElementReenterTransition", 21},
700 {"resumeWhilePausing", 21},
701 {"datePickerMode", 21},
702 {"timePickerMode", 21},
703 {"inset", 21},
704 {"letterSpacing", 21},
705 {"fontFeatureSettings", 21},
706 {"outlineProvider", 21},
707 {"contentAgeHint", 21},
708 {"country", 21},
709 {"windowSharedElementsUseOverlay", 21},
710 {"reparent", 21},
711 {"reparentWithOverlay", 21},
712 {"ambientShadowAlpha", 21},
713 {"spotShadowAlpha", 21},
714 {"navigationIcon", 21},
715 {"navigationContentDescription", 21},
716 {"fragmentExitTransition", 21},
717 {"fragmentEnterTransition", 21},
718 {"fragmentSharedElementEnterTransition", 21},
719 {"fragmentReturnTransition", 21},
720 {"fragmentSharedElementReturnTransition", 21},
721 {"fragmentReenterTransition", 21},
722 {"fragmentAllowEnterTransitionOverlap", 21},
723 {"fragmentAllowReturnTransitionOverlap", 21},
724 {"patternPathData", 21},
725 {"strokeAlpha", 21},
726 {"fillAlpha", 21},
727 {"windowActivityTransitions", 21},
728 {"colorEdgeEffect", 21}};
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800729
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700730size_t FindAttributeSdkLevel(const ResourceName& name) {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700731 if (name.package != "android" && name.type != ResourceType::kAttr) {
732 return 0;
733 }
Adam Lesinski75f3a552015-06-03 14:54:23 -0700734
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700735 auto iter = sAttrMap.find(name.entry);
736 if (iter != sAttrMap.end()) {
737 return iter->second;
738 }
739 return SDK_LOLLIPOP_MR1;
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800740}
741
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700742std::pair<StringPiece, int> GetDevelopmentSdkCodeNameAndVersion() {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700743 return std::make_pair(StringPiece(sDevelopmentSdkCodeName),
744 sDevelopmentSdkLevel);
Adam Lesinskifb6312f2016-06-28 14:40:32 -0700745}
746
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700747} // namespace aapt