if (strcmp(name, kWildcardName) == 0) {
if (out) out->uiMode =
(out->uiMode&~ResTable_config::MASK_UI_MODE_TYPE)
- | ResTable_config::UI_MODE_TYPE_NORMAL;
+ | ResTable_config::UI_MODE_TYPE_ANY;
+ return true;
+ } else if (strcmp(name, "desk") == 0) {
+ if (out) out->uiMode =
+ (out->uiMode&~ResTable_config::MASK_UI_MODE_TYPE)
+ | ResTable_config::UI_MODE_TYPE_DESK;
return true;
} else if (strcmp(name, "car") == 0) {
if (out) out->uiMode =
return true;
}
+ if (strcmp(name, "xhdpi") == 0) {
+ if (out) out->density = ResTable_config::DENSITY_MEDIUM*2;
+ return true;
+ }
+
char* c = (char*)name;
while (*c >= '0' && *c <= '9') {
c++;
uint8_t mask = 0;
uint8_t value = 0;
if (strcmp(name, kWildcardName) == 0) {
- mask = out->MASK_NAVHIDDEN;
- value = out->NAVHIDDEN_ANY;
+ mask = ResTable_config::MASK_NAVHIDDEN;
+ value = ResTable_config::NAVHIDDEN_ANY;
} else if (strcmp(name, "navexposed") == 0) {
- mask = out->MASK_NAVHIDDEN;
- value = out->NAVHIDDEN_NO;
+ mask = ResTable_config::MASK_NAVHIDDEN;
+ value = ResTable_config::NAVHIDDEN_NO;
} else if (strcmp(name, "navhidden") == 0) {
- mask = out->MASK_NAVHIDDEN;
- value = out->NAVHIDDEN_YES;
+ mask = ResTable_config::MASK_NAVHIDDEN;
+ value = ResTable_config::NAVHIDDEN_YES;
}
if (mask != 0) {
getNavigationName(navigation.string(), ¶ms);
getScreenSizeName(screenSize.string(), ¶ms);
getVersionName(version.string(), ¶ms);
+
+ // Fix up version number based on specified parameters.
+ int minSdk = 0;
+ if ((params.uiMode&ResTable_config::MASK_UI_MODE_TYPE)
+ != ResTable_config::UI_MODE_TYPE_ANY
+ || (params.uiMode&ResTable_config::MASK_UI_MODE_NIGHT)
+ != ResTable_config::UI_MODE_NIGHT_ANY) {
+ minSdk = SDK_FROYO;
+ } else if ((params.screenLayout&ResTable_config::MASK_SCREENSIZE)
+ != ResTable_config::SCREENSIZE_ANY
+ || (params.screenLayout&ResTable_config::MASK_SCREENLONG)
+ != ResTable_config::SCREENLONG_ANY
+ || params.density != ResTable_config::DENSITY_DEFAULT) {
+ minSdk = SDK_DONUT;
+ }
+
+ if (minSdk > params.sdkVersion) {
+ params.sdkVersion = minSdk;
+ }
+
return params;
}