From: jihye424.kim Date: Tue, 19 May 2015 09:03:42 +0000 (+0900) Subject: Bug fix: can not launch emulator manager X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=605200aa9ca77fb8b95228283dd84483f81d3b35;p=sdk%2Femulator%2Femulator-manager.git Bug fix: can not launch emulator manager - If there are vms created emulator manager before version 2.4 emulator manager is not launched because of null pointer exception - fix 1. add null checking option 2. change platform name to empty string from null Change-Id: If2581b75981a30d7633f8769b04bdf0b229bcecd Signed-off-by: jihye424.kim --- diff --git a/src/org/tizen/emulator/manager/platform/Profile.java b/src/org/tizen/emulator/manager/platform/Profile.java index bc1a0ca..e762be1 100644 --- a/src/org/tizen/emulator/manager/platform/Profile.java +++ b/src/org/tizen/emulator/manager/platform/Profile.java @@ -117,13 +117,12 @@ public class Profile { if (vm.getPropertyValue().baseImage == null) { if (vm.getImageType().equals(FSImageType.standard)) { for (BaseImage b : imageList) { - if (vm.getBaseImageName().equals(b.getName())) { + if (vm.getBaseImagePath().equals(b.getPath())) { vm.getPropertyValue().baseImage = b; break; } } } else { - // TODO: create custom base image for (Platform p : platformList) { if (vm.getImagePlatform().equals(p.getName())) { try { diff --git a/src/org/tizen/emulator/manager/platform/ProfileList.java b/src/org/tizen/emulator/manager/platform/ProfileList.java index 4104fea..47db349 100644 --- a/src/org/tizen/emulator/manager/platform/ProfileList.java +++ b/src/org/tizen/emulator/manager/platform/ProfileList.java @@ -213,20 +213,32 @@ public class ProfileList { } private static void checkingBaseImageBinaryVersion() { - // TODO EmulatorVMList vms = EmulatorVMList.getInstance(); vms.refreshProperties(); - totalProfile.clearVMsList(); - String binaryVersion = ""; String path = ""; BaseImage base = null; + Profile profile = null; for (VMProperty prop : (VMProperty[])vms.getProperties()) { - totalProfile.addEmulator(prop); - prop.initVMWorker(); - if (prop.getImageType() == FSImageType.standard) { + profile = ProfileList.getProfile(prop.getImageProfile()); + if (profile == null) { + continue; + } + + for (BaseImage b : profile.getImageList()) { + if (prop.getBaseImagePath().equals(b.getPath())) { + prop.getPropertyValue().baseImage = b; + break; + } + } + if (prop.getPropertyValue().baseImage == null) { + continue; + } + + prop.initVMWorker(); + binaryVersion = prop.getConfiguration().getBaseInformation().getDiskImage().getBaseDiskImage().getVersion(); path = prop.getConfiguration().getBaseInformation().getDiskImage().getBaseDiskImage().getValue(); base = prop.getPropertyValue().baseImage; diff --git a/src/org/tizen/emulator/manager/vms/VMProperty.java b/src/org/tizen/emulator/manager/vms/VMProperty.java index 7ddf071..19a2aa7 100644 --- a/src/org/tizen/emulator/manager/vms/VMProperty.java +++ b/src/org/tizen/emulator/manager/vms/VMProperty.java @@ -214,7 +214,7 @@ public class VMProperty { String version = getImageVersion(); String profile = getImageProfile(); if (version == null || profile == null) { - return null; + return ""; } return profile + "-" + version;