summaryrefslogtreecommitdiffstats
path: root/healthd
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2015-12-28 15:33:01 -0800
committerMark Salyzyn <salyzyn@google.com>2015-12-29 11:34:29 -0800
commit10b82b683405e9ccd0cc162fa44a2ec6a9f26448 (patch)
treeb0e78abff45b56ca1c0611973d6aab7ac4b4c8a9 /healthd
parentb5e821316da31d2f4d06c3dea74ed57098b69033 (diff)
downloadsystem_core-10b82b683405e9ccd0cc162fa44a2ec6a9f26448.tar.gz
system_core-10b82b683405e9ccd0cc162fa44a2ec6a9f26448.tar.bz2
system_core-10b82b683405e9ccd0cc162fa44a2ec6a9f26448.zip
logd: isMonotonic improvements
Use 1972 as a right delineation. Otherwise use half way point between the monotonic and realtime. Treat correction factor as unsigned, ensure that any wrapping to a negative value is dropped or set to EPOCH. Acknowledge that we can get a more accurate time track by acquiring the time rather than relying on healthd timestamp. Bug: 26331432 Change-Id: I09075fca58676a30cf7d87baf2d4b0f53795abaa
Diffstat (limited to 'healthd')
-rw-r--r--healthd/BatteryMonitor.cpp20
1 files changed, 0 insertions, 20 deletions
diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp
index 0085a078f..cdfe9c573 100644
--- a/healthd/BatteryMonitor.cpp
+++ b/healthd/BatteryMonitor.cpp
@@ -30,7 +30,6 @@
#include <batteryservice/BatteryService.h>
#include <cutils/klog.h>
#include <cutils/properties.h>
-#include <log/log_read.h>
#include <utils/Errors.h>
#include <utils/String8.h>
#include <utils/Vector.h>
@@ -313,25 +312,6 @@ bool BatteryMonitor::update(void) {
props.chargerUsbOnline ? "u" : "",
props.chargerWirelessOnline ? "w" : "");
- log_time realtime(CLOCK_REALTIME);
- time_t t = realtime.tv_sec;
- struct tm *tmp = gmtime(&t);
- if (tmp) {
- static const char fmt[] = " %Y-%m-%d %H:%M:%S.XXXXXXXXX UTC";
- len = strlen(dmesgline);
- if ((len < (sizeof(dmesgline) - sizeof(fmt) - 8)) // margin
- && strftime(dmesgline + len, sizeof(dmesgline) - len,
- fmt, tmp)) {
- char *usec = strchr(dmesgline + len, 'X');
- if (usec) {
- len = usec - dmesgline;
- snprintf(dmesgline + len, sizeof(dmesgline) - len,
- "%09u", realtime.tv_nsec);
- usec[9] = ' ';
- }
- }
- }
-
KLOG_WARNING(LOG_TAG, "%s\n", dmesgline);
}