summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2012-09-19 14:53:10 -0700
committerBen Cheng <bccheng@google.com>2012-09-19 14:53:10 -0700
commit971f7e9f5d81d30bee5063a32f4953da754ee7ce (patch)
tree3f02122dca3ab62a3bfe415808778550ccc81130
parent3cdccc6f852be345c43bdfbc2466aa17c1173c9c (diff)
downloadframeworks_native-971f7e9f5d81d30bee5063a32f4953da754ee7ce.zip
frameworks_native-971f7e9f5d81d30bee5063a32f4953da754ee7ce.tar.gz
frameworks_native-971f7e9f5d81d30bee5063a32f4953da754ee7ce.tar.bz2
Disable the use of clock_gettime for now.
Bug: 7100774 Change-Id: I6ede2a37a5d485134fe419b5dc766f70ae4af9d4
-rw-r--r--libs/utils/SystemClock.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/utils/SystemClock.cpp b/libs/utils/SystemClock.cpp
index fe4ae91..ec2d82e 100644
--- a/libs/utils/SystemClock.cpp
+++ b/libs/utils/SystemClock.cpp
@@ -153,17 +153,25 @@ int64_t elapsedRealtimeNano()
{
#ifdef HAVE_ANDROID_OS
struct timespec ts;
- int result = clock_gettime(CLOCK_BOOTTIME, &ts);
+ int result;
int64_t timestamp;
static volatile int64_t prevTimestamp;
static volatile int prevMethod;
+#if 0
+ /*
+ * b/7100774
+ * clock_gettime appears to have clock skews and can sometimes return
+ * backwards values. Disable its use until we find out what's wrong.
+ */
+ result = clock_gettime(CLOCK_BOOTTIME, &ts);
if (result == 0) {
timestamp = seconds_to_nanoseconds(ts.tv_sec) + ts.tv_nsec;
checkTimeStamps(timestamp, &prevTimestamp, &prevMethod,
METHOD_CLOCK_GETTIME);
return timestamp;
}
+#endif
// CLOCK_BOOTTIME doesn't exist, fallback to /dev/alarm
static int s_fd = -1;