Consolidate WpHash declaration to a common file
Bug: b/193932763
Test: frameworks/native/test
Change-Id: Ib19f191ed8031b77c059b644fe5df3c8137e6619
diff --git a/services/surfaceflinger/Scheduler/VsyncModulator.h b/services/surfaceflinger/Scheduler/VsyncModulator.h
index b2b0451..2000c54 100644
--- a/services/surfaceflinger/Scheduler/VsyncModulator.h
+++ b/services/surfaceflinger/Scheduler/VsyncModulator.h
@@ -25,6 +25,8 @@
#include <binder/IBinder.h>
#include <utils/Timers.h>
+#include "../WpHash.h"
+
namespace android::scheduler {
// State machine controlled by transaction flags. VsyncModulator switches to early phase offsets
@@ -124,12 +126,6 @@
using Schedule = TransactionSchedule;
std::atomic<Schedule> mTransactionSchedule = Schedule::Late;
- struct WpHash {
- size_t operator()(const wp<IBinder>& p) const {
- return std::hash<IBinder*>()(p.unsafe_get());
- }
- };
-
std::unordered_set<wp<IBinder>, WpHash> mEarlyWakeupRequests GUARDED_BY(mMutex);
std::atomic<bool> mRefreshRateChangePending = false;