Skip to content

Commit 2ad0545

Browse files
committed
Revert "Make abi selectable while creating new AVD"
This reverts commit ff8fd7f. Conflicts: src/processing/mode/android/AVD.java src/processing/mode/android/AndroidEditor.java
1 parent b7fd754 commit 2ad0545

File tree

3 files changed

+9
-46
lines changed

3 files changed

+9
-46
lines changed

src/processing/mode/android/AVD.java

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package processing.mode.android;
22

33
import processing.app.Base;
4-
//import processing.app.Preferences;
54
import processing.app.exec.ProcessHelper;
65
import processing.app.exec.ProcessResult;
76
import processing.core.PApplet;
@@ -44,26 +43,21 @@ public class AVD {
4443

4544
/** "android-7" or "Google Inc.:Google APIs:7" */
4645
protected String target;
47-
48-
/** x86, x86_64 or armeabi **/
49-
protected String abi;
50-
51-
public static final String PREF_KEY_ABI = "android.sdk.abi";
52-
public static final String[] ABI = {"armeabi", "x86", "x86_64"};
5346

5447
/** Default virtual device used by Processing. */
55-
static public AVD defaultAVD;
48+
static public final AVD defaultAVD =
49+
new AVD("Processing-0" + Base.getRevision(),
50+
"android-" + AndroidBuild.sdkVersion);
5651
// "Google Inc.:Google APIs:" + AndroidBuild.sdkVersion);
5752

5853
static ArrayList<String> avdList;
5954
static ArrayList<String> badList;
6055
// static ArrayList<String> skinList;
6156

6257

63-
public AVD(String name, String target, String abi) {
58+
public AVD(final String name, final String target) {
6459
this.name = name;
6560
this.target = target;
66-
this.abi = abi;
6761
}
6862

6963

@@ -144,11 +138,12 @@ protected boolean create(final AndroidSDK sdk) throws IOException {
144138
"-t", target,
145139
"-c", DEFAULT_SDCARD_SIZE,
146140
"-s", DEFAULT_SKIN,
147-
"--abi", abi
141+
"--abi", "armeabi"
148142
};
149143

150144
// Set the list to null so that exists() will check again
151145
avdList = null;
146+
152147
final ProcessHelper p = new ProcessHelper(params);
153148
try {
154149
// Passes 'no' to "Do you wish to create a custom hardware profile [no]"
@@ -176,10 +171,8 @@ protected boolean create(final AndroidSDK sdk) throws IOException {
176171
}
177172

178173

179-
static public boolean ensureProperAVD(final AndroidSDK sdk, final String abi) {
174+
static public boolean ensureProperAVD(final AndroidSDK sdk) {
180175
try {
181-
defaultAVD = new AVD("Processing-0" + Base.getRevision(),
182-
"android-" + AndroidBuild.sdkVersion, abi);
183176
if (defaultAVD.exists(sdk)) {
184177
// System.out.println("the avd exists");
185178
return true;

src/processing/mode/android/AndroidEditor.java

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import javax.swing.*;
3535
import javax.swing.event.ChangeEvent;
3636
import javax.swing.event.ChangeListener;
37-
3837
import java.awt.event.ActionEvent;
3938
import java.awt.event.ActionListener;
4039
import java.io.File;
@@ -248,32 +247,7 @@ public void run() {
248247
}.start();
249248

250249
menu.add(sdkMenu);
251-
menu.addSeparator();
252-
253-
final JMenu abiMenu = new JMenu("Select CPU/ABI");
254-
for (int i = 0; i < AVD.ABI.length; ++i) {
255-
JMenuItem menuItem = new JCheckBoxMenuItem(AVD.ABI[i]);
256-
abiMenu.add(menuItem);
257-
if (AVD.ABI[i].equals(Preferences.get(AVD.PREF_KEY_ABI))) {
258-
menuItem.setSelected(true);
259-
}
260-
}
261-
262-
for (int i = 0; i < abiMenu.getItemCount(); ++i) {
263-
final JMenuItem abiItem = abiMenu.getItem(i);
264-
abiItem.addActionListener(new ActionListener() {
265-
@Override
266-
public void actionPerformed(ActionEvent e) {
267-
for (int j = 0; j < abiMenu.getItemCount(); ++j) {
268-
abiMenu.getItem(j).setSelected(false);
269-
}
270-
abiItem.setSelected(true);
271-
Preferences.set(AVD.PREF_KEY_ABI, abiItem.getText());
272-
}
273-
});
274-
}
275-
276-
menu.add(abiMenu);
250+
277251
menu.addSeparator();
278252

279253
item = new JMenuItem("Android SDK Manager");

src/processing/mode/android/AndroidMode.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,7 @@ public void handleRunEmulator(Sketch sketch, RunnerListener listener) throws Ske
198198
listener.statusNotice("Building Android project...");
199199
build.build("debug");
200200

201-
String abi = Preferences.get(AVD.PREF_KEY_ABI);
202-
if (abi.equals("")) {
203-
abi = "x86_64";
204-
}
205-
boolean avd = AVD.ensureProperAVD(sdk, abi);
201+
boolean avd = AVD.ensureProperAVD(sdk);
206202
if (!avd) {
207203
SketchException se =
208204
new SketchException("Could not create a virtual device for the emulator.");

0 commit comments

Comments
 (0)