[Title]fix multi instance checking
authormunkyu.im <munkyu.im@samsung.com>
Mon, 26 Mar 2012 09:37:05 +0000 (18:37 +0900)
committermunkyu.im <munkyu.im@samsung.com>
Mon, 26 Mar 2012 09:37:05 +0000 (18:37 +0900)
[Type]
[Module]
[Priority]
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

src/org/tizen/emulator/manager/tool/FileIO.java
src/org/tizen/emulator/manager/tool/Launcher.java
src/org/tizen/emulator/manager/vms/VMProcess.java

index 26c85e7..36b1648 100644 (file)
@@ -17,7 +17,7 @@ public class FileIO {
        private final static String log_suffix = File.separator +"logs";
        private final static String x86_kernel_suffix = File.separator +"kernel-img";
        private final static String skin_suffix = File.separator + "skins";
-
+       private final static String arch_extension = ".x86";
        private static String currentPath;
        private static String emulatorPath;
        private static String sdkPath;
@@ -172,6 +172,10 @@ public class FileIO {
        public String getVirtualTargetPath(String name) {
                return getTizenVmsArchPath() + File.separator + name;
        }
+       
+       public String getVirtualTargetImagePath(String name) {
+               return getTizenVmsArchPath() + File.separator + name + File.separator + "emulimg-" + name + arch_extension;
+       }
 
        public String getVirtualTargetLogPath(String name) {
                return getVirtualTargetPath(name) + log_suffix;
index cbb85da..8e16ab2 100644 (file)
@@ -30,7 +30,7 @@ public class Launcher {
                if(!vmprocess.checkIfRunning(property))
                {
                        MessageBox alert = new MessageBox(shell, SWT.OK);
-                       alert.setMessage("Can not execute emulator.\n Emulator instance with the same name is running now.");
+                       alert.setMessage("Can not execute emulator.\nEmulator instance with the same name is running now.");
                        alert.open();
                        return;
                }
index bbac691..742944b 100644 (file)
@@ -60,8 +60,8 @@ public class VMProcess {
                                                
                                                if(isLinux > -1) {
                                                        while ((line = stdOut.readLine()) != null) {
-                                                                                                       if(line.contains(FileIO.getInstance().getVirtualTargetPath(property.getName()))) {
-                                                                                                               //System.out.println("exist in"+ line);
+                                                                                                       if(line.contains(FileIO.getInstance().getVirtualTargetImagePath(property.getName()))) {
+                                                                                                               //System.out.println("exist in "+ line);
                                                                                                                stdOut.close();
                                                                                                                return false; 
                                                                                                        }