SF: Adding statistical mode

- Adding statistical mode for timestamp intervals.
- Moving math calculations into util class, and adding a unit test.

See go/surface-flinger-scheduler for more info and systrace links.

Test: SF tests pass. Adding new test class.
Bug: 113612090
Change-Id: I3c3a73e3d8719e47326d8a48d27683037b7beb47
diff --git a/services/surfaceflinger/Scheduler/LayerHistory.h b/services/surfaceflinger/Scheduler/LayerHistory.h
index 76c1352..c6fab07 100644
--- a/services/surfaceflinger/Scheduler/LayerHistory.h
+++ b/services/surfaceflinger/Scheduler/LayerHistory.h
@@ -25,6 +25,8 @@
 
 #include <utils/Timers.h>
 
+#include "SchedulerUtils.h"
+
 namespace android {
 
 /*
@@ -52,12 +54,11 @@
     const std::unordered_map<std::string, nsecs_t>& get(size_t index) const;
     // Returns the total size of the ring buffer. The value is always the same regardless
     // of how many slots we filled in.
-    static constexpr size_t getSize() { return ARRAY_SIZE; }
+    static constexpr size_t getSize() { return scheduler::ARRAY_SIZE; }
 
 private:
     size_t mCounter = 0;
-    static constexpr size_t ARRAY_SIZE = 30;
-    std::array<std::unordered_map<std::string, nsecs_t>, ARRAY_SIZE> mElements;
+    std::array<std::unordered_map<std::string, nsecs_t>, scheduler::ARRAY_SIZE> mElements;
 };
 
 } // namespace android
\ No newline at end of file