Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Support Google API images in Android Emulator. #267

Merged
merged 1 commit into from
Apr 6, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion mobile/android/android-emulator-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,11 @@ class AndroidEmulatorServices implements Mobile.IEmulatorPlatformServices {
var platform = target.replace('android-', '');
var platformNumber = +platform;
if (isNaN(platformNumber)) {
if (platform === "L") {
// this might be a google image
platform = target.split(":")[2];
if (platform) {
platformNumber = +platform;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will happen in case this is some strange image and after splitting by ":" we get string or undefined for platform. +ing it will set platformNumber ot NaN and the code will not work

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, if is a strange image, the code won't work anyway. Right now it returns undefined and the map()s after that do not find a suitable image and we give a message "no image found". I can make it throw an exception but this ultimately would give the same message to the user, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I didn't check the rest of the code, sorry.

} else if (platform === "L") { // Android SDK 20 was actually marked with the letter L
platformNumber = 20;
}
}
Expand Down