AI 149397: ADT 1807821 and 1841824: Fixes in android tool

- Bug 1807821: create avd -f option does nothing.
  - Bug 1841824: NPE during AVD delete or update.
  BUG=1841824,1807821

Automated import of CL 149397
This commit is contained in:
Raphael Moll
2009-05-29 16:39:42 -07:00
committed by The Android Open Source Project
parent 838143199e
commit 6f56ebc737
2 changed files with 137 additions and 133 deletions

View File

@@ -454,16 +454,18 @@ class Main {
// display some extra values.
Map<String, String> properties = info.getProperties();
String skin = properties.get(AvdManager.AVD_INI_SKIN_NAME);
if (skin != null) {
mSdkLog.printf(" Skin: %s\n", skin);
}
String sdcard = properties.get(AvdManager.AVD_INI_SDCARD_SIZE);
if (sdcard == null) {
sdcard = properties.get(AvdManager.AVD_INI_SDCARD_PATH);
}
if (sdcard != null) {
mSdkLog.printf(" Sdcard: %s\n", sdcard);
if (properties != null) {
String skin = properties.get(AvdManager.AVD_INI_SKIN_NAME);
if (skin != null) {
mSdkLog.printf(" Skin: %s\n", skin);
}
String sdcard = properties.get(AvdManager.AVD_INI_SDCARD_SIZE);
if (sdcard == null) {
sdcard = properties.get(AvdManager.AVD_INI_SDCARD_PATH);
}
if (sdcard != null) {
mSdkLog.printf(" Sdcard: %s\n", sdcard);
}
}
}
@@ -508,7 +510,7 @@ class Main {
}
try {
boolean removePrevious = false;
boolean removePrevious = mSdkCommandLine.getFlagForce();
AvdManager avdManager = new AvdManager(mSdkManager, mSdkLog);
String avdName = mSdkCommandLine.getParamName();
@@ -522,8 +524,7 @@ class Main {
AvdInfo info = avdManager.getAvd(avdName, false /*validAvdOnly*/);
if (info != null) {
if (mSdkCommandLine.getFlagForce()) {
removePrevious = true;
if (removePrevious) {
mSdkLog.warning(
"Android Virtual Device '%s' already exists and will be replaced.",
avdName);