From 050bcb67487a8d84263799a49599a149f419d3ad Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Fri, 10 Jun 2011 16:56:02 -0700 Subject: Properly handle CPU Arch/ABI in AVDs. When we introduced x86 support in the tree there was no generic emulator exe able to act as a launcher to the -arm and -x86 versions of the emulator. This exe is now present and packaged with the SDK, so we remove the code to launch either arch specific version and instead make the AVD Manager and ADT simply launch the normal emulator once again. (This has the side effect of making ADT 12 able to run on Tools r11 and below.) For this to run though, hw.cpu.arch must be set in the AVD if the arch is not arm. The new AVD manager sets this properly. Also fixed some issues from my previous fix to the hardware property. Now the list contains all of them but there's a isValidForUi that's used to not show up some prop in the UI. Change-Id: I7a264a59cb3c5051ff62f6103da9663c7b7eb22f --- .../sdkuilib/internal/widgets/AvdCreationDialog.java | 13 ++++++++++--- .../android/sdkuilib/internal/widgets/AvdDetailsDialog.java | 3 ++- .../com/android/sdkuilib/internal/widgets/AvdSelector.java | 7 +++++-- .../sdkuilib/internal/widgets/HardwarePropertyChooser.java | 3 ++- 4 files changed, 19 insertions(+), 7 deletions(-) (limited to 'sdkmanager/libs/sdkuilib') diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java index 0932378..98a7286 100644 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java @@ -305,8 +305,8 @@ final class AvdCreationDialog extends GridDialog { //ABI group label = new Label(parent, SWT.NONE); - label.setText("ABI:"); - tooltip = "The ABI to use in the virtual device"; + label.setText("CPU/ABI:"); + tooltip = "The CPU/ABI to use in the virtual device"; label.setToolTipText(tooltip); mAbiTypeCombo = new Combo(parent, SWT.READ_ONLY | SWT.DROP_DOWN); @@ -792,11 +792,17 @@ final class AvdCreationDialog extends GridDialog { mProperties.clear(); if (props != null) { - mProperties.putAll(props); + for (Entry entry : props.entrySet()) { + HardwareProperty prop = mHardwareMap.get(entry.getKey()); + if (prop != null && prop.isValidForUi()) { + mProperties.put(entry.getKey(), entry.getValue()); + } + } } // Cleanup known non-hardware properties mProperties.remove(AvdManager.AVD_INI_ABI_TYPE); + mProperties.remove(AvdManager.AVD_INI_CPU_ARCH); mProperties.remove(AvdManager.AVD_INI_SKIN_PATH); mProperties.remove(AvdManager.AVD_INI_SKIN_NAME); mProperties.remove(AvdManager.AVD_INI_SDCARD_SIZE); @@ -804,6 +810,7 @@ final class AvdCreationDialog extends GridDialog { mProperties.remove(AvdManager.AVD_INI_SNAPSHOT_PRESENT); mProperties.remove(AvdManager.AVD_INI_IMAGES_1); mProperties.remove(AvdManager.AVD_INI_IMAGES_2); + mHardwareViewer.refresh(); } diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdDetailsDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdDetailsDialog.java index 2167248..a99a304 100644 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdDetailsDialog.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdDetailsDialog.java @@ -66,7 +66,7 @@ final class AvdDetailsDialog extends SwtBaseDialog { if (mAvdInfo != null) { displayValue(c, "Name:", mAvdInfo.getName()); - displayValue(c, "ABI:", AvdInfo.getPrettyAbiType(mAvdInfo.getAbiType())); + displayValue(c, "CPU/ABI:", AvdInfo.getPrettyAbiType(mAvdInfo.getAbiType())); displayValue(c, "Path:", mAvdInfo.getDataFolderPath()); @@ -103,6 +103,7 @@ final class AvdDetailsDialog extends SwtBaseDialog { HashMap copy = new HashMap(properties); // remove stuff we already displayed (or that we don't want to display) copy.remove(AvdManager.AVD_INI_ABI_TYPE); + copy.remove(AvdManager.AVD_INI_CPU_ARCH); copy.remove(AvdManager.AVD_INI_SKIN_NAME); copy.remove(AvdManager.AVD_INI_SKIN_PATH); copy.remove(AvdManager.AVD_INI_SDCARD_SIZE); diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdSelector.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdSelector.java index bbf17fa..637a109 100644 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdSelector.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdSelector.java @@ -20,6 +20,7 @@ import com.android.prefs.AndroidLocation.AndroidLocationException; import com.android.sdklib.IAndroidTarget; import com.android.sdklib.ISdkLog; import com.android.sdklib.NullSdkLog; +import com.android.sdklib.SdkConstants; import com.android.sdklib.internal.avd.AvdInfo; import com.android.sdklib.internal.avd.AvdManager; import com.android.sdklib.internal.avd.AvdInfo.AvdStatus; @@ -373,7 +374,7 @@ public final class AvdSelector { final TableColumn column3 = new TableColumn(mTable, SWT.NONE); column3.setText("API Level"); final TableColumn column4 = new TableColumn(mTable, SWT.NONE); - column4.setText("ABI"); + column4.setText("CPU/ABI"); adjustColumnsWidth(mTable, column0, column1, column2, column3, column4); setupSelectionListener(mTable); @@ -1032,7 +1033,9 @@ public final class AvdSelector { AvdStartDialog dialog = new AvdStartDialog(mTable.getShell(), avdInfo, mOsSdkPath, mController); if (dialog.open() == Window.OK) { - String path = avdInfo.getEmulatorPath(mOsSdkPath + File.separator); + String path = mOsSdkPath + File.separator + + SdkConstants.OS_SDK_TOOLS_FOLDER + + SdkConstants.FN_EMULATOR; final String avdName = avdInfo.getName(); diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/HardwarePropertyChooser.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/HardwarePropertyChooser.java index ac2a38f..d92e0fb 100644 --- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/HardwarePropertyChooser.java +++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/HardwarePropertyChooser.java @@ -64,7 +64,8 @@ class HardwarePropertyChooser extends GridDialog { // simple list for index->name resolution. final ArrayList indexToName = new ArrayList(); for (Entry entry : mProperties.entrySet()) { - if (mExceptProperties.contains(entry.getKey()) == false) { + if (entry.getValue().isValidForUi() && + mExceptProperties.contains(entry.getKey()) == false) { c.add(entry.getValue().getAbstract()); indexToName.add(entry.getKey()); } -- cgit v1.1