synchronized void processLine(String line, StreamGobbler.OnLineListener listener) {
      if (listener != null) {
        if (handler != null) {
          final String fLine = line;
          final StreamGobbler.OnLineListener fListener = listener;

          startCallback();
          handler.post(new Runnable() {

            @Override
            public void run() {
              try {
                fListener.onLine(fLine);
              } finally {
                endCallback();
              }
            }
          });
        } else {
          listener.onLine(line);
        }
      }
    }
Process a normal stdout/stderr line

@param line
    Line to process
@param listener
    Callback to call or null
imitate/src/main/java/com/engineer/imitate/shell/Shell.java