* @return A human-readable error message, or <code>null</code> if the config is valid.
*/
private String isConfigValid(String avdName, String osVersion, String screenDensity,
String screenResolution, String deviceLocale, String sdCardSize) {
if (getUseNamedEmulator()) {
ValidationResult result = descriptor.doCheckAvdName(avdName, false);
if (result.isFatal()) {
return result.getMessage();
}
} else {
ValidationResult result = descriptor.doCheckOsVersion(osVersion, false);
if (result.isFatal()) {
return result.getMessage();
}
result = descriptor.doCheckScreenDensity(screenDensity, false);
if (result.isFatal()) {
return result.getMessage();
}
result = descriptor.doCheckScreenResolution(screenResolution, null, null, false);
if (result.isFatal()) {
return result.getMessage();
}
result = descriptor.doCheckDeviceLocale(deviceLocale, false);
if (result.isFatal()) {
return result.getMessage();
}
result = descriptor.doCheckSdCardSize(sdCardSize, false);
if (result.isFatal()) {
return result.getMessage();
}
}
return null;
}