return 0;
}
+ // screen layout
+ if (getScreenLayoutName(part.string(), &config)) {
+ *axis = AXIS_SCREENLAYOUT;
+ *value = config.screenLayout;
+ return 0;
+ }
+
// version
if (getVersionName(part.string(), &config)) {
*axis = AXIS_VERSION;
{
Vector<String8> parts;
- String8 mcc, mnc, loc, orient, den, touch, key, keysHidden, nav, size, vers;
+ String8 mcc, mnc, loc, orient, den, touch, key, keysHidden, nav, size, layout, vers;
const char *p = dir;
const char *q;
//printf("not screen size: %s\n", part.string());
}
+ if (getScreenLayoutName(part.string())) {
+ layout = part;
+
+ index++;
+ if (index == N) {
+ goto success;
+ }
+ part = parts[index];
+ } else {
+ //printf("not screen layout: %s\n", part.string());
+ }
+
if (getVersionName(part.string())) {
vers = part;
this->keyboard = key;
this->navigation = nav;
this->screenSize = size;
+ this->screenLayout = layout;
this->version = vers;
// what is this anyway?
s += ",";
s += screenSize;
s += ",";
+ s += screenLayout;
+ s += ",";
s += version;
return s;
}
s += "-";
s += screenSize;
}
+ if (this->screenLayout != "") {
+ s += "-";
+ s += screenLayout;
+ }
if (this->version != "") {
s += "-";
s += version;
ResTable_config* out)
{
if (strcmp(name, kWildcardName) == 0) {
- if (out) out->density = 0;
+ if (out) out->density = ResTable_config::DENSITY_DEFAULT;
return true;
}
+
+ if (strcmp(name, "nodpi") == 0) {
+ if (out) out->density = ResTable_config::DENSITY_NONE;
+ return true;
+ }
+
char* c = (char*)name;
while (*c >= '0' && *c <= '9') {
c++;
return true;
}
+bool AaptGroupEntry::getScreenLayoutName(const char* name,
+ ResTable_config* out)
+{
+ if (strcmp(name, kWildcardName) == 0) {
+ if (out) out->screenLayout = out->SCREENLAYOUT_ANY;
+ return true;
+ } else if (strcmp(name, "smallscreen") == 0) {
+ if (out) out->screenLayout = out->SCREENLAYOUT_SMALL;
+ return true;
+ } else if (strcmp(name, "normalscreen") == 0) {
+ if (out) out->screenLayout = out->SCREENLAYOUT_NORMAL;
+ return true;
+ } else if (strcmp(name, "largescreen") == 0) {
+ if (out) out->screenLayout = out->SCREENLAYOUT_LARGE;
+ return true;
+ }
+
+ return false;
+}
+
bool AaptGroupEntry::getVersionName(const char* name,
ResTable_config* out)
{
if (v == 0) v = keyboard.compare(o.keyboard);
if (v == 0) v = navigation.compare(o.navigation);
if (v == 0) v = screenSize.compare(o.screenSize);
+ if (v == 0) v = screenLayout.compare(o.screenLayout);
if (v == 0) v = version.compare(o.version);
return v;
}
getKeyboardName(keyboard.string(), ¶ms);
getNavigationName(navigation.string(), ¶ms);
getScreenSizeName(screenSize.string(), ¶ms);
+ getScreenLayoutName(screenLayout.string(), ¶ms);
getVersionName(version.string(), ¶ms);
return params;
}