aboutsummaryrefslogtreecommitdiffstats
path: root/sdkmanager/libs/sdkuilib/src
diff options
context:
space:
mode:
authorRaphael Moll <ralf@android.com>2012-04-03 15:56:22 -0700
committerRaphael Moll <ralf@android.com>2012-04-03 16:00:03 -0700
commit1d3cefadbc55507611b1b8ad7cd4d7f6ce4467b9 (patch)
tree57cc970b687eb2729089ca14d160f0103253d51d /sdkmanager/libs/sdkuilib/src
parent6462650a787c96cbb371d6aca201af3d613aad24 (diff)
downloadsdk-1d3cefadbc55507611b1b8ad7cd4d7f6ce4467b9.zip
sdk-1d3cefadbc55507611b1b8ad7cd4d7f6ce4467b9.tar.gz
sdk-1d3cefadbc55507611b1b8ad7cd4d7f6ce4467b9.tar.bz2
SDK Manager: Remember last seen source names.
One issue in the SDK Manager is that sources that are partially installed first are loaded first. However we used to remember the source URL but not its name, resulting in some sources having no visible name when loaded from installed packages. This solves the issue by storing the known source names locally. This expands on the local settings file that stores whether a source is enable/disable to add more attributes. Change-Id: Ideca00820ccad01b4cacd997b1e43b53270fa1bc
Diffstat (limited to 'sdkmanager/libs/sdkuilib/src')
-rwxr-xr-xsdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AddonSitesDialog.java3
-rwxr-xr-xsdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PkgContentProvider.java9
-rwxr-xr-xsdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java4
3 files changed, 14 insertions, 2 deletions
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AddonSitesDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AddonSitesDialog.java
index e02d20e..015539c 100755
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AddonSitesDialog.java
+++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/AddonSitesDialog.java
@@ -19,6 +19,7 @@ package com.android.sdkuilib.internal.repository.sdkman2;
import com.android.sdklib.internal.repository.SdkAddonSource;
import com.android.sdklib.internal.repository.SdkSource;
import com.android.sdklib.internal.repository.SdkSourceCategory;
+import com.android.sdklib.internal.repository.SdkSourceProperties;
import com.android.sdklib.internal.repository.SdkSources;
import com.android.sdkuilib.internal.repository.UpdaterBaseDialog;
import com.android.sdkuilib.internal.repository.UpdaterData;
@@ -290,6 +291,8 @@ public class AddonSitesDialog extends UpdaterBaseDialog {
if (mSources != null && mSourcesChangeListener != null) {
mSources.removeChangeListener(mSourcesChangeListener);
}
+ SdkSourceProperties p = new SdkSourceProperties();
+ p.save();
super.close();
}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PkgContentProvider.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PkgContentProvider.java
index bd3bd0e..4867ebb 100755
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PkgContentProvider.java
+++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/PkgContentProvider.java
@@ -213,7 +213,12 @@ public class PkgContentProvider implements ITreeContentProvider {
@Override
public String getLongDescription() {
- return mSource.getLongDescription();
+ if (mSource.isEnabled()) {
+ return mSource.getLongDescription();
+ } else {
+ return "Loading from this site has been disabled. " +
+ "To enable it, use Tools > Manage Add-ons Sites.";
+ }
}
@Override
@@ -221,7 +226,7 @@ public class PkgContentProvider implements ITreeContentProvider {
if (mSource.isEnabled()) {
return "No packages found.";
} else {
- return "This site is disabled.";
+ return "This site is disabled. ";
}
}
}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java
index e5f26cd..2f77e45 100755
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java
+++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/sdkman2/SdkUpdaterWindowImpl2.java
@@ -20,6 +20,7 @@ package com.android.sdkuilib.internal.repository.sdkman2;
import com.android.sdklib.ISdkLog;
import com.android.sdklib.SdkConstants;
import com.android.sdklib.internal.repository.ITaskFactory;
+import com.android.sdklib.internal.repository.SdkSourceProperties;
import com.android.sdkuilib.internal.repository.AboutDialog;
import com.android.sdkuilib.internal.repository.ISdkUpdaterWindow;
import com.android.sdkuilib.internal.repository.MenuBarWrapper;
@@ -149,6 +150,9 @@ public class SdkUpdaterWindowImpl2 implements ISdkUpdaterWindow {
}
}
+ SdkSourceProperties p = new SdkSourceProperties();
+ p.save();
+
dispose(); //$hide$
}