Bug fix: can not launch emulator manager
authorjihye424.kim <jihye424.kim@samsung.com>
Tue, 19 May 2015 09:03:42 +0000 (18:03 +0900)
committerjihye424.kim <jihye424.kim@samsung.com>
Tue, 19 May 2015 10:08:33 +0000 (19:08 +0900)
- 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 <jihye424.kim@samsung.com>
src/org/tizen/emulator/manager/platform/Profile.java
src/org/tizen/emulator/manager/platform/ProfileList.java
src/org/tizen/emulator/manager/vms/VMProperty.java

index bc1a0ca..e762be1 100644 (file)
@@ -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 {
index 4104fea..47db349 100644 (file)
@@ -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;
index 7ddf071..19a2aa7 100644 (file)
@@ -214,7 +214,7 @@ public class VMProperty {
                String version = getImageVersion();
                String profile = getImageProfile();
                if (version == null || profile == null) {
-                       return null;
+                       return "";
                }
 
                return profile + "-" + version;