aboutsummaryrefslogtreecommitdiffstats
path: root/sdkmanager
diff options
context:
space:
mode:
authorRaphael <raphael@google.com>2009-06-17 11:26:10 -0700
committerRaphael <raphael@google.com>2009-06-17 11:30:38 -0700
commit5dafec27ae2cb37516d1b12c3dd0fbbcbe188e59 (patch)
treee99ec5dea399d3e2f97e9d87562a8d0225420974 /sdkmanager
parent35e4bb1ba9295340d37b83bec9a56ddbbb25caa8 (diff)
downloadsdk-5dafec27ae2cb37516d1b12c3dd0fbbcbe188e59.zip
sdk-5dafec27ae2cb37516d1b12c3dd0fbbcbe188e59.tar.gz
sdk-5dafec27ae2cb37516d1b12c3dd0fbbcbe188e59.tar.bz2
SDK Updater: fix install of new packages from remote page.
Diffstat (limited to 'sdkmanager')
-rwxr-xr-xsdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/LocalPackagesPage.java2
-rwxr-xr-xsdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/RemotePackagesPage.java2
-rwxr-xr-xsdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java13
3 files changed, 14 insertions, 3 deletions
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/LocalPackagesPage.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/LocalPackagesPage.java
index 804b053..f87f30a 100755
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/LocalPackagesPage.java
+++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/LocalPackagesPage.java
@@ -241,7 +241,7 @@ public class LocalPackagesPage extends Composite implements ISdkListener {
}
private void onUpdateInstalledPackage() {
- mUpdaterData.updateAll(null /*selectedArchives*/);
+ mUpdaterData.updateOrInstallAll(null /*selectedArchives*/);
}
private void onDeleteSelected() {
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/RemotePackagesPage.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/RemotePackagesPage.java
index 88ad591..e187de6 100755
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/RemotePackagesPage.java
+++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/RemotePackagesPage.java
@@ -292,7 +292,7 @@ public class RemotePackagesPage extends Composite implements ISdkListener {
}
if (mUpdaterData != null) {
- mUpdaterData.updateAll(archives);
+ mUpdaterData.updateOrInstallAll(archives);
}
}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java
index 77760a3..f8373dd 100755
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java
+++ b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java
@@ -314,13 +314,24 @@ class UpdaterData {
* This can be null, in which case a list of remote archive is fetched from all
* available sources.
*/
- public void updateAll(Collection<Archive> selectedArchives) {
+ public void updateOrInstallAll(Collection<Archive> selectedArchives) {
if (selectedArchives == null) {
refreshSources(true);
}
final Map<Archive, Archive> updates = findUpdates(selectedArchives);
+ if (selectedArchives != null) {
+ // Not only we want to perform updates but we also want to install the
+ // selected archives. If they do not match an update, list them anyway
+ // except they map themselves to null (no "old" archive)
+ for (Archive a : selectedArchives) {
+ if (!updates.containsValue(a)) {
+ updates.put(a, null);
+ }
+ }
+ }
+
UpdateChooserDialog dialog = new UpdateChooserDialog(this, updates);
dialog.open();