DO NOT MERGE ANYWHERE (nyc-dr1-dev) audioflinger: add watchdog on main mutex
Check every 10 seconds if main audioflinger mutex can be acquired and
trigger audioserver process restart if not.
This will allow to capture tombstones of locked up situations and avoid
the disruption of a system_server restart.
Bug: 30737845
Bug: 30388410
Change-Id: I8a78b8cf813982f70ea598a6d42affc0ecaa76c9
(cherry picked from commit 17a58b2560c38a8e31a38186f9ab6eb98a38e229)
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 79f4a66..c32eadd 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -246,7 +246,9 @@
}
mPatchPanel = new PatchPanel(this);
-
+ // FIXME: bug 30737845: trigger audioserver restart if main audioflinger lock
+ // is held continuously for more than 3 seconds
+ mLockWatch = new LockWatch(mLock, String8("AudioFlinger"));
mMode = AUDIO_MODE_NORMAL;
}
@@ -279,6 +281,7 @@
}
}
}
+ mLockWatch->requestExitAndWait();
}
static const char * const audio_interfaces[] = {