Merge "Fixes the system server hang forever issue caused by the monkey not read completed the sync pipe."
This commit is contained in:
@@ -433,8 +433,18 @@ public class Monkey {
|
|||||||
String s;
|
String s;
|
||||||
while ((s = inBuffer.readLine()) != null) {
|
while ((s = inBuffer.readLine()) != null) {
|
||||||
if (mRequestBugreport) {
|
if (mRequestBugreport) {
|
||||||
logOutput.write(s);
|
try {
|
||||||
logOutput.write("\n");
|
// When no space left on the device the write will
|
||||||
|
// occurs an I/O exception, so we needed to catch it
|
||||||
|
// and continue to read the data of the sync pipe to
|
||||||
|
// aviod the bugreport hang forever.
|
||||||
|
logOutput.write(s);
|
||||||
|
logOutput.write("\n");
|
||||||
|
} catch (IOException e) {
|
||||||
|
while(inBuffer.readLine() != null) {}
|
||||||
|
System.err.println(e.toString());
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
System.err.println(s);
|
System.err.println(s);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user