use of com.intellij.util.io.BaseDataReader in project android by JetBrains.
the class EmulatorProcessHandler method startNotify.
@Override
public void startNotify() {
// Wait for both the stdout and stderr reader threads to finish and then indicate that the process has terminated
addProcessListener(new ProcessAdapter() {
@Override
public void startNotified(final ProcessEvent event) {
try {
String presentableName = CommandLineUtil.extractPresentableName(myCommandLine.getCommandLineString());
final BaseDataReader stdoutReader = new EmulatorOutputReader(myProcess.getInputStream(), ProcessOutputTypes.STDOUT, presentableName);
final BaseDataReader stderrReader = new EmulatorOutputReader(myProcess.getErrorStream(), ProcessOutputTypes.STDERR, presentableName);
executeTask(() -> {
try {
stderrReader.waitFor();
stdoutReader.waitFor();
} catch (InterruptedException ignore) {
} finally {
notifyProcessTerminated(0);
}
});
} finally {
removeProcessListener(this);
}
}
});
super.startNotify();
}
Aggregations