Esempio n. 1
0
 private String getUsbMode() {
   String result = null;
   StringBuilder strBuilder = new StringBuilder();
   strBuilder.append("cat ");
   strBuilder.append(mPortFile);
   Xlog.v(TAG, "get current dramc cmd: " + strBuilder.toString());
   try {
     if (ShellExe.RESULT_SUCCESS == ShellExe.execCommand(strBuilder.toString(), true)) {
       result = ShellExe.getOutput();
     }
   } catch (IOException e) {
     Xlog.w(TAG, "get current dramc IOException: " + e.getMessage());
   }
   return result;
 }
Esempio n. 2
0
 private boolean isUsbConnected() {
   String result = null;
   boolean isConnected = false;
   StringBuilder strBuilder = new StringBuilder();
   strBuilder.append("cat ");
   strBuilder.append(USB_CONNECT_STATE);
   Xlog.v(TAG, "isUsbConnected cmd: " + strBuilder.toString());
   try {
     if (ShellExe.RESULT_SUCCESS == ShellExe.execCommand(strBuilder.toString(), true)) {
       result = ShellExe.getOutput();
       if (result.equals(USB_CONFIGURED) || result.equals(USB_CONNECT)) {
         isConnected = true;
       }
     }
   } catch (IOException e) {
     Xlog.w(TAG, "get current dramc IOException: " + e.getMessage());
   }
   return isConnected;
 }