Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-14741] Allow for the x86 ABI for android-10.
Google now host the x86 ABI for android-10 rather than Intel,
in the process making it a proper system-image rather than an
add-on. This caused problems with determining if the configured
AVD required an ABI, so now we add some more special handling
for this case.
  • Loading branch information
orrc committed May 17, 2013
1 parent 7dcf3de commit 485d72b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/main/java/hudson/plugins/android_emulator/Constants.java
Expand Up @@ -125,10 +125,12 @@ public boolean isCustomPlatform() {
* emulator creation.
*/
public boolean requiresAbi() {
// TODO: Could be improved...
// TODO: Could be improved / this logic should ideally be moved to emulator creation time...
// This is a relatively naive approach; e.g. addons for level <= 13 can have ABIs, though
// the only example seen so far is the Intel x86 level 10 image we explicitly include here..
return level >= 14 || Util.fixNull(name).contains("Intel Atom x86 System Image");
// But, since the Intel x86 for SDK 10 is now hosted by Google, we can't rely on the name...
return level == 10 || level >= 14
|| Util.fixNull(name).contains("Intel Atom x86 System Image");
}

public String getTargetName() {
Expand Down Expand Up @@ -326,4 +328,4 @@ public String toString() {
return alias;
};

}
}
Expand Up @@ -499,8 +499,15 @@ public Boolean call() throws AndroidEmulatorException {
builder.add(osVersion.getTargetName());

if (targetAbi != null && osVersion.requiresAbi()) {
builder.add("--abi");
builder.add(targetAbi);
// This is an unpleasant side-effect of there being an ABI for android-10,
// and that Google renamed the image after its initial release from Intel...
// Ideally, as stated in AndroidPlatform#requiresAbi, we should preferably check
// via the "android list target" command whether an ABI is actually required.
if (osVersion.getSdkLevel() != 10 || targetAbi.equals("armeabi")
|| targetAbi.equals("x86")) {
builder.add("--abi");
builder.add(targetAbi);
}
}

// Log command line used, for info
Expand Down
Expand Up @@ -280,7 +280,7 @@ private static List<String> getSdkComponentsForPlatform(PrintStream logger, Stri

// Add system image, if required
// Even if a system image doesn't exist for this platform, the installer silently ignores it
if (dependentPlatform >= 14 && includeSystemImages) {
if (dependentPlatform >= 10 && includeSystemImages) {
components.add(String.format("sysimg-%s", dependentPlatform));
}

Expand Down

0 comments on commit 485d72b

Please sign in to comment.