From: greatim Date: Mon, 31 Aug 2015 13:57:35 +0000 (+0900) Subject: [PLATFORM] disable binary setting for product target (unroot device) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b5bbfa7d0a3c3f9096cccbec183c6a22e279ad7;p=sdk%2Ftools%2Fdynamic-analyzer.git [PLATFORM] disable binary setting for product target (unroot device) disable binary setting for product target (unroot device) Change-Id: I2d7780f33a9f90f68f381d9a7acd2096d9a02614 Signed-off-by: greatim --- 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 e253f0a..084588a 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/IDECommunicator.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/IDECommunicator.java @@ -408,6 +408,8 @@ public class IDECommunicator implements Runnable { pkgInfo.getMainApp().setLocalPackagePath(localPackagePathList); } } else if (projectType.equals(PROJECT_TYPE_LIBRARY)) { + // TODO : UX improvement, and more test in unrooted device + if (localPackagePathList.size() == 0) { Logger.error("rpm package for library is not set"); UIAction.showWarning(UserErrorWarningLabels.ERROR_LIBTRACE_START diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/UIAction.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/UIAction.java index 312d528..bfed7c5 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/UIAction.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/UIAction.java @@ -36,6 +36,7 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.tizen.dynamicanalyzer.common.DAResult; +import org.tizen.dynamicanalyzer.constant.CommonConstants; import org.tizen.dynamicanalyzer.nl.SummaryLabels; import org.tizen.dynamicanalyzer.resources.ImageResources; import org.tizen.dynamicanalyzer.setting.SettingConstants; @@ -161,7 +162,26 @@ public class UIAction { } public static void showWarning(final DAResult result) { - showWarning(result.getMessage() + " (" + result.getErrorNumber() + ")"); + showWarning(result.getMessage() + CommonConstants.SPACE + CommonConstants.OPEN_BRACKET + + result.getErrorNumber() + CommonConstants.CLOSE_BRACKET); + } + + public static void showWarning(final Shell shell, final String message) { + Display.getDefault().asyncExec(new Runnable() { + @Override + public void run() { + DADialog dialog = new DADialog(shell, SWT.NONE); + dialog.setIcon(ImageResources.DIALOG_WARNING_ICON); + dialog.setMessage(message); + dialog.open(); + } + }); + } + + public static void showWarning(final Shell shell, final DAResult result) { + showWarning(shell, result.getMessage() + CommonConstants.SPACE + + CommonConstants.OPEN_BRACKET + result.getErrorNumber() + + CommonConstants.CLOSE_BRACKET); } public static List getPageNames() { 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 5435218..60fb2f4 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/UserErrorWarningLabels.properties +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/UserErrorWarningLabels.properties @@ -7,7 +7,7 @@ ERROR_DEVICE_NOT_FOUND=There is no connected device.\nPlease check the connectio ERROR_UNSUPPORTED_PROTOCOL=This version of platform of the device is not supported.\nPlease update the platform of device and retry. ERROR_BY_SECURITY_REASON=This operation is not allowed due to security reason. -ERROR_APP_SELECT_BY_SECURITY=Selected application cannot be traced due to security reason. +ERROR_APP_SELECT_BY_SECURITY=Selected application cannot be traced due to security reason. ERROR_NONEXIST_APPLICATION=does not exist in device.\nPlease check that the application has been installed successfully. ERROR_UNSUPPORTED_APPLICATION=is unsupported application. diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialogBinarySettingsPage.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialogBinarySettingsPage.java index 690d5bf..cda247a 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialogBinarySettingsPage.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialogBinarySettingsPage.java @@ -101,7 +101,9 @@ public class SettingDialogBinarySettingsPage extends DAPageComposite { public void handleClickEvent(DACustomButton button) { DeviceInfo curDev = Global.getCurrentDeviceInfo(); if (curDev == null) { - UIAction.showWarning(new DAResult(ErrorCode.ERR_NO_DEVICE), 400, 150); + UIAction.showWarning(getShell(), new DAResult(ErrorCode.ERR_NO_DEVICE)); + } else if (!curDev.isRootAvailable()) { + UIAction.showWarning(getShell(), new DAResult(ErrorCode.ERR_BY_SECURITY)); } else { DeviceExplorerDialog dialog = new DeviceExplorerDialog(getShell(), true); // dialog.setFilter(".so"); @@ -150,7 +152,12 @@ public class SettingDialogBinarySettingsPage extends DAPageComposite { public void handleClickEvent(DACustomButton button) { DeviceInfo curDev = Global.getCurrentDeviceInfo(); if (curDev == null) { - UIAction.showWarning(new DAResult(ErrorCode.ERR_NO_DEVICE), 400, 150); + UIAction.showWarning(getShell(), new DAResult(ErrorCode.ERR_NO_DEVICE)); + return; + } + + if (!curDev.isRootAvailable()) { + UIAction.showWarning(getShell(), new DAResult(ErrorCode.ERR_BY_SECURITY)); return; }