Skip to content

Commit 3d20a37

Browse files
committed
getting rid of this public static crap
1 parent e828b48 commit 3d20a37

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/processing/mode/android/AndroidMode.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ public class AndroidMode extends JavaMode {
4242
private File coreZipLocation;
4343
private AndroidRunner runner;
4444

45-
static boolean sdkDownloadInProgress = false;
46-
4745

4846
public AndroidMode(Base base, File folder) {
4947
super(base, folder);
@@ -145,7 +143,7 @@ public void checkSDK(Editor parent) {
145143
}
146144
}
147145
if (sdk == null) {
148-
if (!sdkDownloadInProgress) {
146+
if (!AndroidSDK.isDownloading()) {
149147
Base.showWarning("It's gonna be a bad day",
150148
"The Android SDK could not be loaded.\n" +
151149
"Use of Android Mode will be all but disabled.",

src/processing/mode/android/AndroidSDK.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class AndroidSDK {
2626
private final File platformTools;
2727
private final File androidTool;
2828

29+
static private boolean downloading;
30+
2931
private static final String ANDROID_SDK_PRIMARY =
3032
"Is the Android SDK installed?";
3133

@@ -272,10 +274,15 @@ static public AndroidSDK locate(final Frame window, final AndroidMode androidMod
272274
}
273275
}
274276

277+
static boolean isDownloading() {
278+
return downloading;
279+
}
280+
275281
static public AndroidSDK download(final AndroidMode androidMode) throws BadSDKException {
276-
AndroidMode.sdkDownloadInProgress = true;
282+
// TODO This is never set back to false once true [fry 150813]
283+
downloading = true;
277284

278-
SwingUtilities.invokeLater(new Runnable() {
285+
EventQueue.invokeLater(new Runnable() {
279286
@Override
280287
public void run() {
281288
SDKDownloader downloader = new SDKDownloader(androidMode);
@@ -394,7 +401,7 @@ public static ProcessResult runADB(final String... cmd)
394401
// }
395402
}
396403

397-
public static class SDKTarget {
404+
static class SDKTarget {
398405
public int version = 0;
399406
public String name;
400407
}

0 commit comments

Comments
 (0)