diff options
| author | Deepanshu Gupta <deepanshu@google.com> | 2014-08-14 12:40:44 -0700 |
|---|---|---|
| committer | Deepanshu Gupta <deepanshu@google.com> | 2014-08-14 12:40:44 -0700 |
| commit | fdf065d45e8571bdb12e84347debc4c8a0265347 (patch) | |
| tree | 2e3a7b31f642c2a7a047324123ebdfae63e99933 | |
| parent | 8b4cfa8a13b265ab7783dee13647073dcf59d213 (diff) | |
| download | platform_tools_swt-fdf065d45e8571bdb12e84347debc4c8a0265347.tar.gz platform_tools_swt-fdf065d45e8571bdb12e84347debc4c8a0265347.tar.bz2 platform_tools_swt-fdf065d45e8571bdb12e84347debc4c8a0265347.zip | |
Skip duplicates devices
This also adds testutils module to the intellij project to fix the
project setup.
Change-Id: I40bb9a8b457a3e12309d28f4f8c386e1f51c0efc
5 files changed, 9 insertions, 4 deletions
diff --git a/.idea/modules.xml b/.idea/modules.xml index fdd24fe..aa8f471 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -16,6 +16,7 @@ <module fileurl="file://$PROJECT_DIR$/sdkstats/sdkstats.iml" filepath="$PROJECT_DIR$/sdkstats/sdkstats.iml" /> <module fileurl="file://$PROJECT_DIR$/sdkmanager/sdkuilib/sdkuilib.iml" filepath="$PROJECT_DIR$/sdkmanager/sdkuilib/sdkuilib.iml" /> <module fileurl="file://$PROJECT_DIR$/swtmenubar/swtmenubar.iml" filepath="$PROJECT_DIR$/swtmenubar/swtmenubar.iml" /> + <module fileurl="file://$PROJECT_DIR$/../base/testutils/testutils.iml" filepath="$PROJECT_DIR$/../base/testutils/testutils.iml" /> <module fileurl="file://$PROJECT_DIR$/traceview/traceview.iml" filepath="$PROJECT_DIR$/traceview/traceview.iml" /> </modules> </component> diff --git a/sdkmanager/sdkuilib/sdkuilib.iml b/sdkmanager/sdkuilib/sdkuilib.iml index fd2fdde..05feb5d 100644 --- a/sdkmanager/sdkuilib/sdkuilib.iml +++ b/sdkmanager/sdkuilib/sdkuilib.iml @@ -15,6 +15,7 @@ <orderEntry type="library" name="org-eclipse-jface-3.6.2" level="project" /> <orderEntry type="library" name="org-eclipse-core-commands-3.6.0" level="project" /> <orderEntry type="library" name="org-eclipse-equinox-common-3.6.0" level="project" /> + <orderEntry type="module" module-name="testutils" scope="TEST" /> </component> </module> diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/ui/DeviceManagerPage.java b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/ui/DeviceManagerPage.java index f948de3..2214cc4 100755 --- a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/ui/DeviceManagerPage.java +++ b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/ui/DeviceManagerPage.java @@ -70,6 +70,7 @@ import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.EnumSet; import java.util.HashMap; @@ -470,7 +471,7 @@ public class DeviceManagerPage extends Composite Table table, Font boldFont, boolean isUser, - List<Device> devices) { + Collection<Device> devicesCollection) { List<Resource> disposables = new ArrayList<Resource>(); Display display = table.getDisplay(); @@ -478,7 +479,7 @@ public class DeviceManagerPage extends Composite boldStyle.font = boldFont; // We need the list to be be modifiable so that we can sort it. - devices = new ArrayList<Device>(devices); + ArrayList<Device> devices = new ArrayList<Device>(devicesCollection); Collections.sort(devices, Device.getDisplayComparator()); // Generate a list of the AVD names using these devices diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/widgets/AvdCreationPresenter.java b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/widgets/AvdCreationPresenter.java index ef16051..81948fa 100755 --- a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/widgets/AvdCreationPresenter.java +++ b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/widgets/AvdCreationPresenter.java @@ -46,6 +46,7 @@ import com.google.common.base.Joiner; import java.io.File; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; @@ -220,7 +221,7 @@ class AvdCreationPresenter { File location = localSdk.getLocation(); if (location != null) { DeviceManager deviceManager = DeviceManager.createInstance(location, mSdkLog); - List<Device> deviceList = deviceManager.getDevices(DeviceManager.ALL_DEVICES); + Collection<Device> deviceList = deviceManager.getDevices(DeviceManager.ALL_DEVICES); // Sort List<Device> nexus = new ArrayList<Device>(deviceList.size()); diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/widgets/DeviceCreationDialog.java b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/widgets/DeviceCreationDialog.java index b153d08..fecae16 100644 --- a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/widgets/DeviceCreationDialog.java +++ b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/widgets/DeviceCreationDialog.java @@ -67,6 +67,7 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; +import java.util.Collection; import java.util.List; import java.util.Map; @@ -76,7 +77,7 @@ public class DeviceCreationDialog extends GridDialog { private final ImageFactory mImageFactory; private final DeviceManager mManager; - private List<Device> mUserDevices; + private Collection<Device> mUserDevices; private Device mDevice; |
