[PLATFORM] disable binary setting for product target (unroot device)
authorgreatim <jaewon81.lim@samsung.com>
Mon, 31 Aug 2015 13:57:35 +0000 (22:57 +0900)
committergreatim <jaewon81.lim@samsung.com>
Tue, 15 Sep 2015 18:57:18 +0000 (03:57 +0900)
disable binary setting for product target (unroot device)

Change-Id: I2d7780f33a9f90f68f381d9a7acd2096d9a02614
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/handlers/UIAction.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/UserErrorWarningLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialogBinarySettingsPage.java

index e253f0a..084588a 100644 (file)
@@ -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
index 312d528..bfed7c5 100644 (file)
@@ -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<String> getPageNames() {
index 5435218..60fb2f4 100644 (file)
@@ -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.
index 690d5bf..cda247a 100644 (file)
@@ -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;
                        }