Skip to content

Commit 1868871

Browse files
committed
use version and api-level to identify a platform, and avoid confusion
with platform previews.
1 parent a9c02e9 commit 1868871

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/processing/mode/android/SDKDownloader.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@
5353

5454
@SuppressWarnings("serial")
5555
public class SDKDownloader extends JDialog implements PropertyChangeListener {
56-
private static final String PLATFORM_API_LEVEL = "22";
56+
// Version and API level are both used to avoid ambiguity with preview versions,
57+
// which might share the API level with the earlier stable platform.
58+
private static final String PLATFORM_VERSION = "6.0";
59+
private static final String PLATFORM_API_LEVEL = "23";
5760

5861
private static final String URL_REPOSITORY = "https://dl-ssl.google.com/android/repository/repository-11.xml";
5962
private static final String URL_REPOSITORY_FOLDER = "http://dl-ssl.google.com/android/repository/";
@@ -214,7 +217,9 @@ private SDKUrlHolder getDownloadUrls(String repositoryUrl, String requiredHostOs
214217
NodeList platformList = doc.getElementsByTagName("sdk:platform");
215218
for(int i = 0; i < platformList.getLength(); i++) {
216219
Node platform = platformList.item(i);
217-
if (((Element) platform).getElementsByTagName("sdk:api-level").item(0).getTextContent().equals(PLATFORM_API_LEVEL)) {
220+
NodeList version = ((Element) platform).getElementsByTagName("sdk:version");
221+
NodeList level = ((Element) platform).getElementsByTagName("sdk:api-level");
222+
if (version.item(0).getTextContent().equals(PLATFORM_VERSION) && level.item(0).getTextContent().equals(PLATFORM_API_LEVEL)) {
218223
Node archiveListItem = ((Element) platform).getElementsByTagName("sdk:archives").item(0);
219224
Node archiveItem = ((Element) archiveListItem).getElementsByTagName("sdk:archive").item(0);
220225
urlHolder.platformUrl = ((Element) archiveItem).getElementsByTagName("sdk:url").item(0).getTextContent();

0 commit comments

Comments
 (0)