Merge "StateMachine.dump produces no output sometimes." into lmp-mr1-dev
This commit is contained in:
@@ -25,6 +25,7 @@ import android.util.Log;
|
|||||||
|
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
import java.io.StringWriter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -1940,19 +1941,25 @@ public class StateMachine {
|
|||||||
* @param args
|
* @param args
|
||||||
*/
|
*/
|
||||||
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
|
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
|
||||||
pw.println(this.toString());
|
// Cannot just invoke pw.println(this.toString()) because if the
|
||||||
|
// resulting string is to long it won't be displayed.
|
||||||
|
pw.println(getName() + ":");
|
||||||
|
pw.println(" total records=" + getLogRecCount());
|
||||||
|
for (int i = 0; i < getLogRecSize(); i++) {
|
||||||
|
pw.println(" rec[" + i + "]: " + getLogRec(i).toString());
|
||||||
|
pw.flush();
|
||||||
|
}
|
||||||
|
pw.println("curState=" + getCurrentState().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringWriter sr = new StringWriter();
|
||||||
sb.append(getName() + ":\n");
|
PrintWriter pr = new PrintWriter(sr);
|
||||||
sb.append(" total records=" + getLogRecCount() + "\n");
|
dump(null, pr, null);
|
||||||
for (int i = 0; i < getLogRecSize(); i++) {
|
pr.flush();
|
||||||
sb.append(" rec[" + i + "]: " + getLogRec(i).toString() + "\n");
|
pr.close();
|
||||||
}
|
return sr.toString();
|
||||||
sb.append("curState=" + getCurrentState().getName());
|
|
||||||
return sb.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user