Permalink
Browse files

[FIXED JENKINS-13205] Ensure AVDs starting from snapshot have a clean…

… SD card.
  • Loading branch information...
orrc committed Mar 25, 2012
1 parent cef80e2 commit 9a329071e96a7e26b99cbc237082daa83178364f
Showing with 16 additions and 4 deletions.
  1. +16 −4 src/main/java/hudson/plugins/android_emulator/EmulatorConfig.java
@@ -372,11 +372,23 @@ public Boolean call() throws AndroidEmulatorException {
if (emulatorExists) {
// AVD exists: check whether there's anything still to be set up
File sdCardFile = new File(getAvdDirectory(homeDir), "sdcard.img");
if (getSdCardSize() != null && !sdCardFile.exists()) {
createSdCard = true;
boolean sdCardRequired = getSdCardSize() != null;

// Check if anything needs to be done for snapshot-enabled builds
if (shouldUseSnapshots() && androidSdk.supportsSnapshots()) {
if (!snapshotsFile.exists()) {
createSnapshot = true;
}

// We should ensure that we start out with a clean SD card for the build
if (sdCardRequired && sdCardFile.exists()) {
sdCardFile.delete();
}
}
if (shouldUseSnapshots() && androidSdk.supportsSnapshots() && !snapshotsFile.exists()) {
createSnapshot = true;

// Flag that we need to generate an SD card, if there isn't one existing
if (sdCardRequired && !sdCardFile.exists()) {
createSdCard = true;
}

// If everything is ready, then return

0 comments on commit 9a32907

Please sign in to comment.