Add supported device checker at Connect(), BaseCommunicator.
Pop-up shown when not supported device connected.
This patch is going to check
'/usr/bin/profile_command' file on target.
If this file doesn't exist, InputStream will be empty.
at that time, Stopping connect(), Make a popup.
Change-Id: Iabf55d9a3d31c203c0d80a1186474081692ebad1
Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
public static final String TIZEN_APP_PATH = "/opt/apps"; //$NON-NLS-1$
public static final String TIZEN_USR_APP_PATH = "/opt/usr/apps"; //$NON-NLS-1$
+ /* Executable file name */
+ public static final String DA_EXECUTABLE = "/usr/bin/profile_command";
+
/* Save Data table */
public static final String LEAK_DATA_TABLE_NAME = "LeakData"; //$NON-NLS-1$
public static final String FAILED_DATA_TABLE_NAME = "FailedData"; //$NON-NLS-1$
public static final String DACOMMAND_CHECK_VERSION = "/usr/bin/profile_command getversion";
public static final String DACOMMAND_READLINK = "/usr/bin/profile_command readlink ";
public static final String DACOMMAND_GETAPI = "/usr/bin/profile_command getprobemap";
+ public static final String DACOMMAND_CHECK_EXIST = "which /usr/bin/profile_command";
// direct shell command
public static final String CMD_FIND_IME = "/usr/bin/pkginfo --arg-flt 10 http://tizen.org/category/ime";
ERR_OUT_OF_MEMORY(-1001, UserErrorWarningLabels.ERROR_OUT_OF_MEMORY),
ERR_NO_DEVICE(-1010, UserErrorWarningLabels.ERROR_DEVICE_NOT_FOUND),
ERR_DISCONNECTED(-1011, UserErrorWarningLabels.ERROR_DEVICE_CONNECTION),
+ ERR_NOT_SUPPORTED(-1012, UserErrorWarningLabels.ERROR_DEVICE_NOT_SUPPORTED),
ERR_NO_APP(-1020, UserErrorWarningLabels.ERROR_NONEXIST_APPLICATION),
ERR_INVALID_APP(-1021, UserErrorWarningLabels.ERROR_UNSUPPORTED_APPLICATION),
ERR_BY_SECURITY(-1030, UserErrorWarningLabels.ERROR_BY_SECURITY_REASON),
}
device.emulatorScreenshot = new EmulatorScreenshot();
}
+
+ final List<String> lines = new ArrayList<String>();
+
+ CommunicatorUtils.execShellCommand(device.getIDevice(),
+ AnalyzerShellCommands.DACOMMAND_CHECK_EXIST, new MultiLineReceiver() {
+ @Override
+ public void processNewLines(String[] newlines) {
+ for (int i = 0; i < newlines.length; i++) {
+ lines.add(newlines[i]);
+ }
+ }
+ });
+
+ if (lines.size() > 0) {
+ if (lines.get(0).contains(AnalyzerConstants.DA_EXECUTABLE)) {
+ Logger.debug("The device is supported : " + device.getIDevice().getDeviceName());
+ }
+ else {
+ Logger.debug("Could not found /usr/bin/profile_command, " + lines.get(0));
+ result = new DAResult(ErrorCode.ERR_NOT_SUPPORTED);
+ return result;
+ }
+ } else {
+ Logger.debug("Could not found /usr/bin/profile_command");
+ result = new DAResult(ErrorCode.ERR_NOT_SUPPORTED);
+ return result;
+ }
+
// start swap manager
CommunicatorUtils.execShellCommand(device.getIDevice(),
import org.eclipse.swt.widgets.Display;
import org.tizen.dynamicanalyzer.common.DAResult;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.common.path.PathManager;
+import org.tizen.dynamicanalyzer.handlers.UIAction;
import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.sdblib.IDevice;
if (result.isSuccess()) {
devices.add(devInfo);
bAdded = true;
- } else {
+ }
+ else if (result.equals(new DAResult(ErrorCode.ERR_NOT_SUPPORTED))){
+ Logger.warning("Cannot found /usr/bin/profile_command : " + result.getMessage());
+ UIAction.showWarning(result);
+ }
+ else {
Logger.warning("Cannot connect with swap manager : " + result.getMessage());
+ UIAction.showWarning(result);
}
return bAdded;
result = new DAResult(ErrorCode.ERR_DISCONNECTED);
return;
}
+
setStageComplete(STAGE.CHECK_DEV);
if (!CommonAction.checkApplicationValidness()) {
Logger.debug("Current device is null");
return false;
}
-
- DeviceInfo foundDev = DeviceManager.getDeviceByName(curDev.getIDevice().getSerialNumber());
- if (foundDev == null) {
- Logger.warning("It is not valid device");
- return false;
- }
-
+
return true;
}
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 ERROR_DEVICE_NOT_SUPPORTED;
public static String ERROR_DEVICE_NOT_FOUND;
public static String ERROR_UNSUPPORTED_PROTOCOL;
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.
+ERROR_DEVICE_NOT_SUPPORTED=Current device is not supported. \nPlease ask to administrator.
ERROR_DEVICE_NOT_FOUND=There is no connected device. \nPlease check the connection with device.
ERROR_UNSUPPORTED_PROTOCOL=This version of platform of the device is not supported.\nPlease update the platform of device and retry.