import org.tizen.emulator.manager.EmulatorManager;
import org.tizen.emulator.manager.logging.EMLogger;
+import org.tizen.emulator.manager.platform.Platform;
+import org.tizen.emulator.manager.platform.Profile;
+import org.tizen.emulator.manager.platform.ProfileList;
import org.tizen.emulator.manager.vms.EmulatorVMList;
public class FilePathResources {
public static String getEmulatorToolPath() {
// TODO return /tools/emulator/bin
- return getEmulatorPath("2.4") + bin_suffix;
+ return getEmulatorPath(getLatestPlatformVersion()) + bin_suffix;
}
public static String getEmulatorPath(String platformVersion) {
- String emulatorPath;
+ String emulatorPath = "";
if (platformVersion == null || platformVersion.isEmpty()) {
- platformVersion = "2.4"; // TODO Get lastest version.
+ platformVersion = getLatestPlatformVersion();
}
try {
emulatorPath = new File(platformsPath + platform_prefix
}
return emulatorPath;
}
+
+ // Return latest platform version in whole profile.
+ private static String getLatestPlatformVersion() {
+ String latestVersion = "0";
+ for (Profile profile : ProfileList.getProfileList()) {
+ Platform platform = profile.getPlatformByLatestVersion();
+ if (platform != null) {
+ int compare = latestVersion.compareTo(platform.getVersion());
+ if (compare < 0) { // totalLatestVesion < platform.getVersion()
+ latestVersion = platform.getVersion();
+ }
+ }
+ }
+ return latestVersion;
+ }
/*
public String getArchPath(){
return arcPath;