aboutsummaryrefslogtreecommitdiffstats
path: root/sdkmanager/app
diff options
context:
space:
mode:
authorRaphael <raphael@google.com>2009-04-28 12:54:47 -0700
committerRaphael <raphael@google.com>2009-04-28 12:54:47 -0700
commit43a421647a9dd93cd98a171bf4722fc3bc6eccb2 (patch)
treeaeaf71e40b431dc42de2160c1fbf97e71cd4150b /sdkmanager/app
parent16121df459183744b7a0ddbb31b9219d746795b8 (diff)
downloadsdk-43a421647a9dd93cd98a171bf4722fc3bc6eccb2.zip
sdk-43a421647a9dd93cd98a171bf4722fc3bc6eccb2.tar.gz
sdk-43a421647a9dd93cd98a171bf4722fc3bc6eccb2.tar.bz2
Fix ADT#1807821: -f option ignored when avd dir already existed.
Also fixed an NPE when parsing some invalid AVDs.
Diffstat (limited to 'sdkmanager/app')
-rw-r--r--sdkmanager/app/src/com/android/sdkmanager/Main.java27
1 files changed, 14 insertions, 13 deletions
diff --git a/sdkmanager/app/src/com/android/sdkmanager/Main.java b/sdkmanager/app/src/com/android/sdkmanager/Main.java
index fc9a2be..35d9bb1 100644
--- a/sdkmanager/app/src/com/android/sdkmanager/Main.java
+++ b/sdkmanager/app/src/com/android/sdkmanager/Main.java
@@ -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);