SF: VSyncReactor add timestamp querying functions
Adds 2 more functions from the DispSync interface to VSyncReactor,
computeNextRefresh, and expectedPresentTime
Bug: 140303479
Test: 3 new units
Change-Id: I75ea79ed749f05daf3337ddc8ca145e2ecceabcd
diff --git a/services/surfaceflinger/tests/unittests/VSyncDispatchRealtimeTest.cpp b/services/surfaceflinger/tests/unittests/VSyncDispatchRealtimeTest.cpp
index c012616..448954f 100644
--- a/services/surfaceflinger/tests/unittests/VSyncDispatchRealtimeTest.cpp
+++ b/services/surfaceflinger/tests/unittests/VSyncDispatchRealtimeTest.cpp
@@ -47,6 +47,8 @@
return timePoint - floor + mPeriod;
}
+ nsecs_t currentPeriod() const final { return mPeriod; }
+
private:
nsecs_t const mPeriod;
};
@@ -73,6 +75,11 @@
mBase = last_known;
}
+ nsecs_t currentPeriod() const final {
+ std::lock_guard<decltype(mMutex)> lk(mMutex);
+ return mPeriod;
+ }
+
private:
std::mutex mutable mMutex;
nsecs_t mPeriod;