am 88b927e2: am c67e5ae2: am 4f5fd780: am 68104b05: Merge "add millisecond timestamp to locallog" into lmp-dev
* commit '88b927e258214a31342326d46f527528e5979f85':
add millisecond timestamp to locallog
diff --git a/core/java/android/util/LocalLog.java b/core/java/android/util/LocalLog.java
index eeb6d58..e49b8c3 100644
--- a/core/java/android/util/LocalLog.java
+++ b/core/java/android/util/LocalLog.java
@@ -20,6 +20,7 @@
import java.io.FileDescriptor;
import java.io.PrintWriter;
+import java.util.Calendar;
import java.util.Iterator;
import java.util.LinkedList;
@@ -30,18 +31,21 @@
private LinkedList<String> mLog;
private int mMaxLines;
- private Time mNow;
+ private long mNow;
public LocalLog(int maxLines) {
mLog = new LinkedList<String>();
mMaxLines = maxLines;
- mNow = new Time();
}
public synchronized void log(String msg) {
if (mMaxLines > 0) {
- mNow.setToNow();
- mLog.add(mNow.format("%H:%M:%S") + " - " + msg);
+ mNow = System.currentTimeMillis();
+ StringBuilder sb = new StringBuilder();
+ Calendar c = Calendar.getInstance();
+ c.setTimeInMillis(mNow);
+ sb.append(String.format("%tm-%td %tH:%tM:%tS.%tL", c, c, c, c, c, c));
+ mLog.add(sb.toString() + " - " + msg);
while (mLog.size() > mMaxLines) mLog.remove();
}
}
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index 5514798..53756d2 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -1072,7 +1072,7 @@
sbuf.append(",ipfail=");
sbuf.append(result.numIpConfigFailures);
}
- sbuf.append(result.autoJoinStatus).append("} ");
+ sbuf.append(",").append(result.autoJoinStatus).append("} ");
}
sbuf.append('\n');
}