diff options
author | Raphael Moll <> | 2009-04-16 12:59:01 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-04-16 12:59:01 -0700 |
commit | bacd7355b08936f53dc0d0fd3a8d803b05d60208 (patch) | |
tree | 1100a3f7caa1075c555385230d6abb24c4107dfa /eclipse | |
parent | 8a5333530341ebf87ffe8be0bdfb4ed90a696cfb (diff) | |
download | sdk-bacd7355b08936f53dc0d0fd3a8d803b05d60208.zip sdk-bacd7355b08936f53dc0d0fd3a8d803b05d60208.tar.gz sdk-bacd7355b08936f53dc0d0fd3a8d803b05d60208.tar.bz2 |
AI 146597: am: CL 146595 ADT #1794560: prevent from loading more than one SDK at once.
Original author: raphael
Merged from: //branches/cupcake/...
Automated import of CL 146597
Diffstat (limited to 'eclipse')
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java index 4a7a002..b5cee81 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java @@ -177,6 +177,8 @@ public class AdtPlugin extends AbstractUIPlugin { private ArrayList<ITargetChangeListener> mTargetChangeListeners = new ArrayList<ITargetChangeListener>(); + protected boolean mSdkIsLoading; + /** * Custom PrintStream for Dx output. This class overrides the method * <code>println()</code> and adds the standard output tag with the @@ -1010,7 +1012,15 @@ public class AdtPlugin extends AbstractUIPlugin { @SuppressWarnings("unchecked") @Override protected IStatus run(IProgressMonitor monitor) { - try { + try { + + if (mSdkIsLoading) { + return new Status(IStatus.WARNING, PLUGIN_ID, + "An Android SDK is already being loaded. Please try again later."); + } + + mSdkIsLoading = true; + SubMonitor progress = SubMonitor.convert(monitor, "Initialize SDK Manager", 100); @@ -1093,6 +1103,7 @@ public class AdtPlugin extends AbstractUIPlugin { } }); } finally { + mSdkIsLoading = false; if (monitor != null) { monitor.done(); } |