diff options
author | Jae Seo <jaeseo@google.com> | 2014-08-25 17:25:40 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-25 17:25:41 +0000 |
commit | 1a95b1a6f3d1c2ed237fd678e1d8c88c2aae97df (patch) | |
tree | 2c8956afbd9baab3e0c8483bae29bc461c544e5e | |
parent | 0e47941d5e952ed8fecd380ffd1bc84b393b0c39 (diff) | |
parent | 2220f6f8a60a9aaf9be1fc3e5ce53ce410efb08e (diff) | |
download | frameworks_base-1a95b1a6f3d1c2ed237fd678e1d8c88c2aae97df.zip frameworks_base-1a95b1a6f3d1c2ed237fd678e1d8c88c2aae97df.tar.gz frameworks_base-1a95b1a6f3d1c2ed237fd678e1d8c88c2aae97df.tar.bz2 |
Merge "CEC: Log the current time instead when the timing information is empty" into lmp-dev
-rw-r--r-- | services/core/java/com/android/server/hdmi/HdmiLogger.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/hdmi/HdmiLogger.java b/services/core/java/com/android/server/hdmi/HdmiLogger.java index 36159cb..93ccfe1 100644 --- a/services/core/java/com/android/server/hdmi/HdmiLogger.java +++ b/services/core/java/com/android/server/hdmi/HdmiLogger.java @@ -47,7 +47,7 @@ final class HdmiLogger { long curTime = SystemClock.uptimeMillis(); Pair<Long, Integer> timing = mWarningTimingCache.get(logMessage); if (shouldLogNow(timing, curTime)) { - Slog.w(mTag, buildMessage(logMessage, timing)); + Slog.w(mTag, buildMessage(logMessage, timing, curTime)); mWarningTimingCache.put(logMessage, new Pair<>(curTime, 1)); } else { increaseLogCount(mWarningTimingCache, logMessage); @@ -58,17 +58,17 @@ final class HdmiLogger { long curTime = SystemClock.uptimeMillis(); Pair<Long, Integer> timing = mErrorTimingCache.get(logMessage); if (shouldLogNow(timing, curTime)) { - Slog.e(mTag, buildMessage(logMessage, timing)); + Slog.e(mTag, buildMessage(logMessage, timing, curTime)); mErrorTimingCache.put(logMessage, new Pair<>(curTime, 1)); } else { increaseLogCount(mErrorTimingCache, logMessage); } } - private String buildMessage(String message, Pair<Long, Integer> timing) { + private String buildMessage(String message, Pair<Long, Integer> timing, long curTime) { return new StringBuilder() - .append("[").append(timing.second).append("]:").append(message) - .toString(); + .append("[").append(timing == null ? curTime : timing.second).append("]:") + .append(message).toString(); } private void increaseLogCount(HashMap<String, Pair<Long, Integer>> cache, String message) { |