diff options
Diffstat (limited to 'src/com/cyanogenmod/filemanager/commands/shell/Program.java')
| -rw-r--r-- | src/com/cyanogenmod/filemanager/commands/shell/Program.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/com/cyanogenmod/filemanager/commands/shell/Program.java b/src/com/cyanogenmod/filemanager/commands/shell/Program.java index ae811c0..1bcc5db 100644 --- a/src/com/cyanogenmod/filemanager/commands/shell/Program.java +++ b/src/com/cyanogenmod/filemanager/commands/shell/Program.java @@ -57,6 +57,10 @@ public abstract class Program extends Command implements Executable { // The listener for the program private ProgramListener mProgramListener; + // Indicate if the program expect some output to stderr. If something is received + // in the stderr the program should be killed + private boolean mExitOnStdErrOutput; + /** * @Constructor of <code>Program</code> * @@ -67,6 +71,7 @@ public abstract class Program extends Command implements Executable { */ public Program(String id, String... args) throws InvalidCommandDefinitionException { super(id, args); + this.mExitOnStdErrOutput = false; } /** @@ -81,6 +86,7 @@ public abstract class Program extends Command implements Executable { public Program(String id, boolean prepare, String... args) throws InvalidCommandDefinitionException { super(id, prepare, args); + this.mExitOnStdErrOutput = false; } /** @@ -102,6 +108,26 @@ public abstract class Program extends Command implements Executable { } /** + * Method that returns if the program should be killed if some output is received in + * the standard error buffer. + * + * @return boolean If the program should be killed + */ + public boolean isExitOnStdErrOutput() { + return this.mExitOnStdErrOutput; + } + + /** + * Method that sets if the program should be killed if some output is received in + * the standard error buffer. + * + * @param exitOnStdErrOutput If the program should be killed + */ + public void setExitOnStdErrOutput(boolean exitOnStdErrOutput) { + this.mExitOnStdErrOutput = exitOnStdErrOutput; + } + + /** * Method that returns if the standard error must be * ignored safely by the shell, and don't check for errors * like <code>NoSuchFileOrDirectory</code> or |
