LockWatch: Update to Mutex::timeLock specs am: 51a6319111 am: 7b960a5dc5
am: ffd7edc622

Change-Id: I3113d03214a783e51ed14ab92a20ec4d80f38dc9
diff --git a/services/audioflinger/LockWatch.cpp b/services/audioflinger/LockWatch.cpp
index 21eed6e..3da7a3d 100644
--- a/services/audioflinger/LockWatch.cpp
+++ b/services/audioflinger/LockWatch.cpp
@@ -32,8 +32,12 @@
     while (!exitPending()) {
         // we neglect previous lock time effect on period
         usleep(mPeriodMs * 1000);
-        if (mLock.timedLock(milliseconds(mTimeOutMs)) != NO_ERROR) {
-            LOG_ALWAYS_FATAL("LockWatch timeout for: %s", mTag.string());
+        if (mLock.timedLock(ms2ns(mTimeOutMs)) != NO_ERROR) {
+            // FIXME: Current implementation of timedLock uses CLOCK_REALTIME which
+            // increments even during CPU suspend.  Check twice to be sure.
+            if (mLock.timedLock(ms2ns(mTimeOutMs)) != NO_ERROR) {
+                LOG_ALWAYS_FATAL("LockWatch timeout for: %s", mTag.string());
+            }
         }
         mLock.unlock();
     }