Don't generate sdkVersion ("-v") qualifiers if they're "natural".

This commit is contained in:
Ryszard Wiśniewski 2010-08-29 23:41:29 +02:00
parent 6d923adf81
commit 5087e915e1

View File

@ -231,13 +231,28 @@ public class ResConfigFlags {
ret.append(String.format("-%dx%d", screenHeight, screenWidth));
}
}
if (sdkVersion != 0) {
if (sdkVersion > getNaturalSdkVersionRequirement()) {
ret.append("-v").append(sdkVersion);
}
return ret.toString();
}
private short getNaturalSdkVersionRequirement() {
if (
(uiMode & (MASK_UI_MODE_TYPE | MASK_UI_MODE_NIGHT)) != 0
) {
return 8;
}
if (
(screenLayout & (MASK_SCREENSIZE | MASK_SCREENLONG)) != 0
|| density != DENSITY_DEFAULT
) {
return 4;
}
return 0;
}
@Override
public String toString() {
return ! getQualifiers().equals("") ? getQualifiers() : "[DEFAULT]";