COMM: fix the exception when connection with manager is not established 19/27519/1
authorgreatim <jaewon81.lim@samsung.com>
Mon, 15 Sep 2014 09:06:28 +0000 (18:06 +0900)
committergreatim <jaewon81.lim@samsung.com>
Mon, 15 Sep 2014 09:06:28 +0000 (18:06 +0900)
fix the exception that occurred when connection with manager is not established.
modify the error message when device was not connect properly.

Change-Id: Ie8bf43e252b610de81f5593cab460fa30a6c1452
Signed-off-by: greatim <jaewon81.lim@samsung.com>
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/IDECommunicator.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/UserErrorWarningLabels.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/UserErrorWarningLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java

index ebdb483..c3710aa 100644 (file)
@@ -352,8 +352,13 @@ public class IDECommunicator implements Runnable {
                Logger.debug("auto start : " + binaryOfTarget);
                DeviceInfo device = DACommunicator.getDeviceByName(deviceName);
                GlobalInformation.setCurrentDeviceInfo(device);
-               DACommunicator.getAppListFromTarget();
+               if (device == null) {
+                       popupMessage(UserErrorWarningLabels.ERROR_DEVICE_CONNECTION);
+                       ToolbarArea.getInstance().setToolbarStartStopState(true);
+                       return;
+               }
 
+               DACommunicator.getAppListFromTarget();
                PackageInfo pkgInfo = null;
                if (projectType.equals(PROJECT_TYPE_OSP) || projectType.equals(PROJECT_TYPE_EFL)
                                || projectType.equals(PROJECT_TYPE_WEBAPP)) {
@@ -394,9 +399,9 @@ public class IDECommunicator implements Runnable {
                                        mainrpm = path;
                                }
                        }
-                       
+
                        String errormsg = binarySettingWithRPM(mainrpm, debugrpm, srcrpm);
-                       if(errormsg != null) {
+                       if (errormsg != null) {
                                Logger.error("error during binary setting wit rpm");
                                popupMessage(errormsg);
                                ToolbarArea.getInstance().setToolbarStartStopState(true);
index 3afe642..ffbde6c 100644 (file)
@@ -9,6 +9,7 @@ public class UserErrorWarningLabels extends NLS {
        public static String ERROR_RPM_NOT_FOUND;
        public static String ERROR_LIB_NOT_FOUND_INRPM;
        public static String ERROR_NO_APPID_FOR_LAUNCHPAD;
+       public static String ERROR_DEVICE_CONNECTION;
 
        public static String WARNING_PATH_NOT_FOUND;
        public static String WARNING_FILE_NOT_FOUND;
index e4b8c64..5a9d04f 100644 (file)
@@ -2,6 +2,7 @@ ERROR_LIBTRACE_START=Library tracing cannot be started properly.
 ERROR_RPM_NOT_FOUND=Library rpm package file cannot be found.
 ERROR_LIB_NOT_FOUND_INRPM=Library file cannot be found in rpm package.
 ERROR_NO_APPID_FOR_LAUNCHPAD=There is no appid for launch_app.
+ERROR_DEVICE_CONNECTION=Failed to connect with the device.\nPlease re-run Dynamic Analyzer and reboot the device.
 
 WARNING_PATH_NOT_FOUND=Path cannot be found.
 WARNING_FILE_NOT_FOUND=File cannot be found.
\ No newline at end of file
index afdbb97..f0b26a5 100755 (executable)
@@ -981,15 +981,21 @@ public class ToolbarArea {
                                        setStartButtonState(false);
                                        return;
                                }
+                               
+                               DeviceInfo curDev = GlobalInformation.getCurrentDeviceInfo();
+                               if (curDev == null) {
+                                       setStartButtonState(false);
+                                       return;
+                               }
 
                                String text = deviceCombo.getText();
-                               String device = GlobalInformation.getCurrentDeviceInfo().getIDevice()
-                                               .getSerialNumber();
+                               String device = curDev.getIDevice().getSerialNumber();
                                if (!device.equals(text)) {
                                        // startButton.setButtonEnabled(false);
                                        setStartButtonState(false);
                                        return;
                                }
+                               
                                setStartButtonState(true);
                                // startButton.setButtonEnabled(true);
                        }