From d56d54195a1dfd9a1b91219f063dd4b5768931a9 Mon Sep 17 00:00:00 2001 From: greatim Date: Mon, 15 Sep 2014 18:06:28 +0900 Subject: [PATCH] COMM: fix the exception when connection with manager is not established 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 --- .../tizen/dynamicanalyzer/communicator/IDECommunicator.java | 11 ++++++++--- .../org/tizen/dynamicanalyzer/nl/UserErrorWarningLabels.java | 1 + .../dynamicanalyzer/nl/UserErrorWarningLabels.properties | 1 + .../src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java | 10 ++++++++-- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/IDECommunicator.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/IDECommunicator.java index ebdb483..c3710aa 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/IDECommunicator.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/IDECommunicator.java @@ -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); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/UserErrorWarningLabels.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/UserErrorWarningLabels.java index 3afe642..ffbde6c 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/UserErrorWarningLabels.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/UserErrorWarningLabels.java @@ -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; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/UserErrorWarningLabels.properties b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/UserErrorWarningLabels.properties index e4b8c64..5a9d04f 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/UserErrorWarningLabels.properties +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/UserErrorWarningLabels.properties @@ -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 diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java index afdbb97..f0b26a5 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java @@ -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); } -- 2.7.4