From e5bfd50ece683b42c0053995d149dc096c80a312 Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Thu, 23 Jul 2009 18:02:07 -0700 Subject: [PATCH] Also filter the list of Archives to only show the compatible ones. --- .../internal/repository/RepoSourcesAdapter.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/RepoSourcesAdapter.java b/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/RepoSourcesAdapter.java index 3ac99c6e5..dbf46f593 100755 --- a/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/RepoSourcesAdapter.java +++ b/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/RepoSourcesAdapter.java @@ -163,7 +163,19 @@ public class RepoSourcesAdapter { } } else if (parentElement instanceof Package) { - return ((Package) parentElement).getArchives(); + Archive[] archives = ((Package) parentElement).getArchives(); + if (mUpdaterData.getSettingsController().getShowUpdateOnly()) { + for (Archive archive : archives) { + // if we only want the compatible archives, then we just take the first + // one. it's unlikely there are 2 compatible archives for the same + // package + if (archive.isCompatible()) { + return new Object[] { archive }; + } + } + } + + return archives; } return new Object[0];