am ca4603db: SDK: fix NPE in AVD Manager > Start when skin.path is missing.

Merge commit 'ca4603db2fa5cd0231d75ebcef239cd69e1772ad' into eclair

* commit 'ca4603db2fa5cd0231d75ebcef239cd69e1772ad':
  SDK: fix NPE in AVD Manager > Start when skin.path is missing.
This commit is contained in:
Raphael
2009-11-06 14:00:55 -08:00
committed by Android Git Automerger

View File

@@ -424,6 +424,7 @@ final class AvdStartDialog extends GridDialog {
mSize2 = Integer.parseInt(m.group(2)); mSize2 = Integer.parseInt(m.group(2));
mSkinDisplay = skinName; mSkinDisplay = skinName;
mEnableScaling = true; mEnableScaling = true;
return;
} }
} }
@@ -431,15 +432,18 @@ final class AvdStartDialog extends GridDialog {
mEnableScaling = false; // default to false for now. mEnableScaling = false; // default to false for now.
// path to the skin layout file. // path to the skin layout file.
File skinFolder = new File(mSdkLocation, prop.get(AvdManager.AVD_INI_SKIN_PATH)); String skinPath = prop.get(AvdManager.AVD_INI_SKIN_PATH);
if (skinFolder.isDirectory()) { if (skinPath != null) {
File layoutFile = new File(skinFolder, "layout"); File skinFolder = new File(mSdkLocation, skinPath);
if (layoutFile.isFile()) { if (skinFolder.isDirectory()) {
if (parseLayoutFile(layoutFile)) { File layoutFile = new File(skinFolder, "layout");
mSkinDisplay = String.format("%1$s (%2$dx%3$d)", skinName, mSize1, mSize2); if (layoutFile.isFile()) {
mEnableScaling = true; if (parseLayoutFile(layoutFile)) {
} else { mSkinDisplay = String.format("%1$s (%2$dx%3$d)", skinName, mSize1, mSize2);
mSkinDisplay = skinName; mEnableScaling = true;
} else {
mSkinDisplay = skinName;
}
} }
} }
} }