SDK Manager: fix NPE in AVD > Start when there's no skin name.
Also log missing config.ini path. SDK BUG 2223760 Change-Id: I4517005e03e90c0b5a52bcb40b0d32eddd03c1f3
This commit is contained in:
@@ -1044,8 +1044,14 @@ public final class AvdManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (configIniFile != null) {
|
if (configIniFile != null) {
|
||||||
|
if (!configIniFile.isFile()) {
|
||||||
|
if (log != null) {
|
||||||
|
log.warning("Missing file '%1$s'.", configIniFile.getPath());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
properties = SdkManager.parsePropertyFile(configIniFile, log);
|
properties = SdkManager.parsePropertyFile(configIniFile, log);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// get name
|
// get name
|
||||||
String name = path.getName();
|
String name = path.getName();
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ final class AvdStartDialog extends GridDialog {
|
|||||||
l.setText("Skin:");
|
l.setText("Skin:");
|
||||||
|
|
||||||
l = new Label(parent, SWT.NONE);
|
l = new Label(parent, SWT.NONE);
|
||||||
l.setText(mSkinDisplay);
|
l.setText(mSkinDisplay == null ? "None" : mSkinDisplay);
|
||||||
l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
|
|
||||||
l = new Label(parent, SWT.NONE);
|
l = new Label(parent, SWT.NONE);
|
||||||
@@ -417,13 +417,16 @@ final class AvdStartDialog extends GridDialog {
|
|||||||
Map<String, String> prop = mAvd.getProperties();
|
Map<String, String> prop = mAvd.getProperties();
|
||||||
String skinName = prop.get(AvdManager.AVD_INI_SKIN_NAME);
|
String skinName = prop.get(AvdManager.AVD_INI_SKIN_NAME);
|
||||||
|
|
||||||
|
if (skinName != null) {
|
||||||
Matcher m = AvdManager.NUMERIC_SKIN_SIZE.matcher(skinName);
|
Matcher m = AvdManager.NUMERIC_SKIN_SIZE.matcher(skinName);
|
||||||
if (m.matches()) {
|
if (m != null && m.matches()) {
|
||||||
mSize1 = Integer.parseInt(m.group(1));
|
mSize1 = Integer.parseInt(m.group(1));
|
||||||
mSize2 = Integer.parseInt(m.group(2));
|
mSize2 = Integer.parseInt(m.group(2));
|
||||||
mSkinDisplay = skinName;
|
mSkinDisplay = skinName;
|
||||||
mEnableScaling = true;
|
mEnableScaling = true;
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// The resolution is inside the layout file of the skin.
|
// The resolution is inside the layout file of the skin.
|
||||||
mEnableScaling = false; // default to false for now.
|
mEnableScaling = false; // default to false for now.
|
||||||
|
|
||||||
@@ -441,7 +444,6 @@ final class AvdStartDialog extends GridDialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a layout file.
|
* Parses a layout file.
|
||||||
|
|||||||
Reference in New Issue
Block a user