SurfaceFlinger: Reset VsyncReactor's timer thread
If any of the syscalls the timer uses returns an error, reset the timer.
This is a workaround for an issue seen where VsyncReactor is not calling
new callbacks. In addition this change adds more log prints to help
identifying the underlying issue.
Bug: 151892277
Test: simulate an error in syscall and observe timer resets
Change-Id: I6fd62f9d73f75f32a87d1483cea14f3f1b358507
diff --git a/services/surfaceflinger/tests/unittests/VSyncDispatchTimerQueueTest.cpp b/services/surfaceflinger/tests/unittests/VSyncDispatchTimerQueueTest.cpp
index 3543361..1899bed 100644
--- a/services/surfaceflinger/tests/unittests/VSyncDispatchTimerQueueTest.cpp
+++ b/services/surfaceflinger/tests/unittests/VSyncDispatchTimerQueueTest.cpp
@@ -71,6 +71,7 @@
MOCK_CONST_METHOD0(now, nsecs_t());
MOCK_METHOD2(alarmIn, void(std::function<void()> const&, nsecs_t time));
MOCK_METHOD0(alarmCancel, void());
+ MOCK_CONST_METHOD1(dump, void(std::string&));
void alarmInDefaultBehavior(std::function<void()> const& callback, nsecs_t time) {
mCallback = callback;
@@ -188,6 +189,7 @@
}
void alarmCancel() final { mControllableClock.alarmCancel(); }
nsecs_t now() const final { return mControllableClock.now(); }
+ void dump(std::string&) const final {}
private:
TimeKeeper& mControllableClock;