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/Scheduler/TimeKeeper.h b/services/surfaceflinger/Scheduler/TimeKeeper.h
index 699cd50..38f0708 100644
--- a/services/surfaceflinger/Scheduler/TimeKeeper.h
+++ b/services/surfaceflinger/Scheduler/TimeKeeper.h
@@ -21,10 +21,24 @@
namespace android::scheduler {
+class Clock {
+public:
+ virtual ~Clock();
+ /*
+ * Returns the SYSTEM_TIME_MONOTONIC, used by testing infra to stub time.
+ */
+ virtual nsecs_t now() const = 0;
+
+protected:
+ Clock() = default;
+ Clock(Clock const&) = delete;
+ Clock& operator=(Clock const&) = delete;
+};
+
/*
* TimeKeeper is the interface for a single-shot timer primitive.
*/
-class TimeKeeper {
+class TimeKeeper : public Clock {
public:
virtual ~TimeKeeper();
@@ -39,11 +53,6 @@
*/
virtual void alarmCancel() = 0;
- /*
- * Returns the SYSTEM_TIME_MONOTONIC, used by testing infra to stub time.
- */
- virtual nsecs_t now() const = 0;
-
protected:
TimeKeeper(TimeKeeper const&) = delete;
TimeKeeper& operator=(TimeKeeper const&) = delete;