OSDN Git Service

ADT: repo schema change tell users to update ADT, not tools.
authorRaphael <raphael@google.com>
Mon, 29 Mar 2010 22:38:04 +0000 (15:38 -0700)
committerRaphael <raphael@google.com>
Mon, 29 Mar 2010 23:14:56 +0000 (16:14 -0700)
SDK Bug 2438713

Change-Id: Ia01ceb415a7b384ff683ab63c2e9a00355fa58c9

sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/RepoSource.java

index 415cba5..dd590f6 100755 (executable)
@@ -249,9 +249,29 @@ public class RepoSource implements IDescription {
         }\r
 \r
         if (usingAlternateXml) {\r
-            String info = "This repository requires a more recent version of the Tools. Please update.";\r
+\r
+            // Is the manager running from inside ADT?\r
+            // We check that com.android.ide.eclipse.adt.AdtPlugin exists using reflection.\r
+\r
+            boolean isADT = false;\r
+            try {\r
+                Class<?> adt = Class.forName("com.android.ide.eclipse.adt.AdtPlugin");  //$NON-NLS-1$\r
+                isADT = (adt != null);\r
+            } catch (ClassNotFoundException e) {\r
+                // pass\r
+            }\r
+\r
+            String info;\r
+            if (isADT) {\r
+                info = "This repository requires a more recent version of ADT. Please update the Eclipse Android plugin.";\r
+                mDescription = "This repository requires a more recent version of ADT, the Eclipse Android plugin.\nYou must update it before you can see other new packages.";\r
+\r
+            } else {\r
+                info = "This repository requires a more recent version of the Tools. Please update.";\r
+                mDescription = "This repository requires a more recent version of the Tools.\nYou must update it before you can see other new packages.";\r
+            }\r
+\r
             mFetchError = mFetchError == null ? info : mFetchError + ". " + info;\r
-            mDescription = "This repository requires a more recent version of the Tools.\nYou must update it before you can see other new packages.";\r
         }\r
 \r
         monitor.incProgress(1);\r