diff options
| author | Igor Kalkov <kalkov@embedded.rwth-aachen.de> | 2016-05-11 16:47:28 +0200 |
|---|---|---|
| committer | Igor Kalkov <kalkov@embedded.rwth-aachen.de> | 2016-06-01 14:43:50 -0700 |
| commit | 90cb9de1c05706d6619b8cc9eaec3424c8b1de4c (patch) | |
| tree | 6978e809650d3ca14c3350abbf5a482b15ca31ca /src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java | |
| parent | 8e28d1f47901c3fb0d587661cea1c9f88ba728ba (diff) | |
Flush the shell console after each command
This patch fixes the file manager on android-n-preview-2 (and maybe
other roms/systems). Observed behavior: no output is produced at StdIn
or StdErr after writing commands to the shell console. This leads to a
timeout and a reallocation of the console in an endless loop. Flushing
the output stream fixes the problem. Not sure if there was a good reason
for not doing it in general.
Change-Id: Ia87aa5065f6c62f133de4bbde4b4a32a4388d784
Diffstat (limited to 'src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java')
| -rw-r--r-- | src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java b/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java index 1ecdc82..45f348b 100644 --- a/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java +++ b/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java @@ -654,6 +654,7 @@ public abstract class ShellConsole extends Console implements Program.ProgramLis this.mFinished = false; this.mNewData = false; this.mOut.write(sb.toString().getBytes()); + this.mOut.flush(); } } catch (InvalidCommandDefinitionException icdEx) { throw new CommandNotFoundException( @@ -1133,6 +1134,7 @@ public abstract class ShellConsole extends Console implements Program.ProgramLis //Test write something to the buffer this.mOut.write(FileHelper.NEWLINE.getBytes()); this.mOut.write(FileHelper.NEWLINE.getBytes()); + this.mOut.flush(); } catch (IOException ioex) { //Something is wrong with the buffers. Reallocate console. Log.w(TAG, |
