SF: Remove dead code from Scheduler
While looking into some other Scheduler changes, I noticed that both
Scheduler::mRenderEventConnection and
Scheduler::mLastCompositeEventConnection are initialized but otherwise
unused. Scheduler::getEventConnection() is never called to retrieve
either value.
As there doesn't seem to be any use for them, let's remove them.
This change also required removing test fixture setup from the unit
tests, as the tests worked to install test double implementations.
Test: atest libsurfaceflinger_unittest
Bug: None
Flag: EXEMPT dead code
Change-Id: Ic004df96dd5fe3dadd0cd1455cd85506736a1875
diff --git a/services/surfaceflinger/Scheduler/Scheduler.cpp b/services/surfaceflinger/Scheduler/Scheduler.cpp
index be00079..5e13154 100644
--- a/services/surfaceflinger/Scheduler/Scheduler.cpp
+++ b/services/surfaceflinger/Scheduler/Scheduler.cpp
@@ -38,7 +38,6 @@
#include <FrameTimeline/FrameTimeline.h>
#include <scheduler/interface/ICompositor.h>
-#include <algorithm>
#include <cinttypes>
#include <cstdint>
#include <functional>
@@ -46,16 +45,15 @@
#include <numeric>
#include <common/FlagManager.h>
-#include "../Layer.h"
#include "EventThread.h"
#include "FrameRateOverrideMappings.h"
#include "FrontEnd/LayerHandle.h"
+#include "Layer.h"
#include "OneShotTimer.h"
#include "RefreshRateStats.h"
#include "SurfaceFlingerFactory.h"
#include "SurfaceFlingerProperties.h"
#include "TimeStats/TimeStats.h"
-#include "VSyncTracker.h"
#include "VsyncConfiguration.h"
#include "VsyncController.h"
#include "VsyncSchedule.h"
@@ -361,10 +359,8 @@
if (cycle == Cycle::Render) {
mRenderEventThread = std::move(eventThread);
- mRenderEventConnection = mRenderEventThread->createEventConnection();
} else {
mLastCompositeEventThread = std::move(eventThread);
- mLastCompositeEventConnection = mLastCompositeEventThread->createEventConnection();
}
}
diff --git a/services/surfaceflinger/Scheduler/Scheduler.h b/services/surfaceflinger/Scheduler/Scheduler.h
index 1367ec3..c88b563 100644
--- a/services/surfaceflinger/Scheduler/Scheduler.h
+++ b/services/surfaceflinger/Scheduler/Scheduler.h
@@ -145,10 +145,6 @@
Cycle, EventRegistrationFlags eventRegistration = {},
const sp<IBinder>& layerHandle = nullptr) EXCLUDES(mChoreographerLock);
- const sp<EventThreadConnection>& getEventConnection(Cycle cycle) const {
- return cycle == Cycle::Render ? mRenderEventConnection : mLastCompositeEventConnection;
- }
-
enum class Hotplug { Connected, Disconnected };
void dispatchHotplug(PhysicalDisplayId, Hotplug);
@@ -467,10 +463,7 @@
void onExpectedPresentTimePosted(TimePoint expectedPresentTime) override EXCLUDES(mDisplayLock);
std::unique_ptr<EventThread> mRenderEventThread;
- sp<EventThreadConnection> mRenderEventConnection;
-
std::unique_ptr<EventThread> mLastCompositeEventThread;
- sp<EventThreadConnection> mLastCompositeEventConnection;
std::atomic<nsecs_t> mLastResyncTime = 0;