From 6505f79d47fe45d9b8a77ca3f179e578ec40a17c Mon Sep 17 00:00:00 2001 From: Dominik Laskowski Date: Wed, 18 Sep 2019 11:10:05 -0700 Subject: SF: Hook up VSYNC injection to Scheduler This CL refactors VSYNC injection to interface with the Scheduler API, and removes otherwise unused EventThread members. Bug: 128863962 Test: sffakehwc_test Change-Id: I2ba143bb78baf3e66a47b90163eacf0d0e431124 --- services/surfaceflinger/Scheduler/DispSyncSource.h | 1 + services/surfaceflinger/Scheduler/EventThread.cpp | 22 ++------ services/surfaceflinger/Scheduler/EventThread.h | 14 ++--- .../surfaceflinger/Scheduler/InjectVSyncSource.h | 3 +- services/surfaceflinger/Scheduler/MessageQueue.cpp | 18 ------- services/surfaceflinger/Scheduler/MessageQueue.h | 4 -- services/surfaceflinger/Scheduler/Scheduler.cpp | 60 ++++++++++++++++------ services/surfaceflinger/Scheduler/Scheduler.h | 20 +++++--- services/surfaceflinger/SurfaceFlinger.cpp | 41 +++------------ services/surfaceflinger/SurfaceFlinger.h | 5 -- .../tests/unittests/EventThreadTest.cpp | 30 ++++++----- .../tests/unittests/SchedulerTest.cpp | 3 -- .../tests/unittests/mock/MockMessageQueue.h | 1 - 13 files changed, 91 insertions(+), 131 deletions(-) diff --git a/services/surfaceflinger/Scheduler/DispSyncSource.h b/services/surfaceflinger/Scheduler/DispSyncSource.h index 740c8c4ee1..536464e8fb 100644 --- a/services/surfaceflinger/Scheduler/DispSyncSource.h +++ b/services/surfaceflinger/Scheduler/DispSyncSource.h @@ -32,6 +32,7 @@ public: ~DispSyncSource() override = default; // The following methods are implementation of VSyncSource. + const char* getName() const override { return mName; } void setVSyncEnabled(bool enable) override; void setCallback(VSyncSource::Callback* callback) override; void setPhaseOffset(nsecs_t phaseOffset) override; diff --git a/services/surfaceflinger/Scheduler/EventThread.cpp b/services/surfaceflinger/Scheduler/EventThread.cpp index 9d1f777859..8d9adc8525 100644 --- a/services/surfaceflinger/Scheduler/EventThread.cpp +++ b/services/surfaceflinger/Scheduler/EventThread.cpp @@ -154,23 +154,11 @@ EventThread::~EventThread() = default; namespace impl { -EventThread::EventThread(std::unique_ptr src, - InterceptVSyncsCallback interceptVSyncsCallback, const char* threadName) - : EventThread(nullptr, std::move(src), std::move(interceptVSyncsCallback), threadName) {} - -EventThread::EventThread(VSyncSource* src, InterceptVSyncsCallback interceptVSyncsCallback, - const char* threadName) - : EventThread(src, nullptr, std::move(interceptVSyncsCallback), threadName) {} - -EventThread::EventThread(VSyncSource* src, std::unique_ptr uniqueSrc, - InterceptVSyncsCallback interceptVSyncsCallback, const char* threadName) - : mVSyncSource(src), - mVSyncSourceUnique(std::move(uniqueSrc)), +EventThread::EventThread(std::unique_ptr vsyncSource, + InterceptVSyncsCallback interceptVSyncsCallback) + : mVSyncSource(std::move(vsyncSource)), mInterceptVSyncsCallback(std::move(interceptVSyncsCallback)), - mThreadName(threadName) { - if (src == nullptr) { - mVSyncSource = mVSyncSourceUnique.get(); - } + mThreadName(mVSyncSource->getName()) { mVSyncSource->setCallback(this); mThread = std::thread([this]() NO_THREAD_SAFETY_ANALYSIS { @@ -178,7 +166,7 @@ EventThread::EventThread(VSyncSource* src, std::unique_ptr uniqueSr threadMain(lock); }); - pthread_setname_np(mThread.native_handle(), threadName); + pthread_setname_np(mThread.native_handle(), mThreadName); pid_t tid = pthread_gettid_np(mThread.native_handle()); diff --git a/services/surfaceflinger/Scheduler/EventThread.h b/services/surfaceflinger/Scheduler/EventThread.h index dd23b88726..a029586088 100644 --- a/services/surfaceflinger/Scheduler/EventThread.h +++ b/services/surfaceflinger/Scheduler/EventThread.h @@ -62,6 +62,8 @@ public: }; virtual ~VSyncSource() {} + + virtual const char* getName() const = 0; virtual void setVSyncEnabled(bool enable) = 0; virtual void setCallback(Callback* callback) = 0; virtual void setPhaseOffset(nsecs_t phaseOffset) = 0; @@ -126,9 +128,7 @@ class EventThread : public android::EventThread, private VSyncSource::Callback { public: using InterceptVSyncsCallback = std::function; - // TODO(b/128863962): Once the Scheduler is complete this constructor will become obsolete. - EventThread(VSyncSource*, InterceptVSyncsCallback, const char* threadName); - EventThread(std::unique_ptr, InterceptVSyncsCallback, const char* threadName); + EventThread(std::unique_ptr, InterceptVSyncsCallback); ~EventThread(); sp createEventConnection( @@ -157,10 +157,6 @@ private: using DisplayEventConsumers = std::vector>; - // TODO(b/128863962): Once the Scheduler is complete this constructor will become obsolete. - EventThread(VSyncSource* src, std::unique_ptr uniqueSrc, - InterceptVSyncsCallback interceptVSyncsCallback, const char* threadName); - void threadMain(std::unique_lock& lock) REQUIRES(mMutex); bool shouldConsumeEvent(const DisplayEventReceiver::Event& event, @@ -174,9 +170,7 @@ private: // Implements VSyncSource::Callback void onVSyncEvent(nsecs_t timestamp) override; - // TODO(b/128863962): Once the Scheduler is complete this pointer will become obsolete. - VSyncSource* mVSyncSource GUARDED_BY(mMutex) = nullptr; - std::unique_ptr mVSyncSourceUnique GUARDED_BY(mMutex) = nullptr; + const std::unique_ptr mVSyncSource GUARDED_BY(mMutex); const InterceptVSyncsCallback mInterceptVSyncsCallback; const char* const mThreadName; diff --git a/services/surfaceflinger/Scheduler/InjectVSyncSource.h b/services/surfaceflinger/Scheduler/InjectVSyncSource.h index 90609afaa7..6c502e6d98 100644 --- a/services/surfaceflinger/Scheduler/InjectVSyncSource.h +++ b/services/surfaceflinger/Scheduler/InjectVSyncSource.h @@ -42,6 +42,7 @@ public: } } + const char* getName() const override { return "inject"; } void setVSyncEnabled(bool) override {} void setPhaseOffset(nsecs_t) override {} void pauseVsyncCallback(bool) {} @@ -51,4 +52,4 @@ private: VSyncSource::Callback* mCallback GUARDED_BY(mCallbackMutex) = nullptr; }; -} // namespace android \ No newline at end of file +} // namespace android diff --git a/services/surfaceflinger/Scheduler/MessageQueue.cpp b/services/surfaceflinger/Scheduler/MessageQueue.cpp index fcb307f213..5318b00983 100644 --- a/services/surfaceflinger/Scheduler/MessageQueue.cpp +++ b/services/surfaceflinger/Scheduler/MessageQueue.cpp @@ -85,24 +85,6 @@ void MessageQueue::init(const sp& flinger) { mHandler = new Handler(*this); } -void MessageQueue::setEventThread(android::EventThread* eventThread, - ResyncCallback resyncCallback) { - if (mEventThread == eventThread) { - return; - } - - if (mEventTube.getFd() >= 0) { - mLooper->removeFd(mEventTube.getFd()); - } - - mEventThread = eventThread; - mEvents = eventThread->createEventConnection(std::move(resyncCallback), - ISurfaceComposer::eConfigChangedSuppress); - mEvents->stealReceiveChannel(&mEventTube); - mLooper->addFd(mEventTube.getFd(), 0, Looper::EVENT_INPUT, MessageQueue::cb_eventReceiver, - this); -} - void MessageQueue::setEventConnection(const sp& connection) { if (mEventTube.getFd() >= 0) { mLooper->removeFd(mEventTube.getFd()); diff --git a/services/surfaceflinger/Scheduler/MessageQueue.h b/services/surfaceflinger/Scheduler/MessageQueue.h index 0b2206d2af..fcfc4aa3f7 100644 --- a/services/surfaceflinger/Scheduler/MessageQueue.h +++ b/services/surfaceflinger/Scheduler/MessageQueue.h @@ -85,8 +85,6 @@ public: virtual ~MessageQueue(); virtual void init(const sp& flinger) = 0; - // TODO(b/128863962): Remove this function once everything is migrated to Scheduler. - virtual void setEventThread(EventThread* events, ResyncCallback resyncCallback) = 0; virtual void setEventConnection(const sp& connection) = 0; virtual void waitMessage() = 0; virtual status_t postMessage(const sp& message, nsecs_t reltime = 0) = 0; @@ -115,7 +113,6 @@ class MessageQueue final : public android::MessageQueue { sp mFlinger; sp mLooper; - android::EventThread* mEventThread; sp mEvents; gui::BitTube mEventTube; sp mHandler; @@ -126,7 +123,6 @@ class MessageQueue final : public android::MessageQueue { public: ~MessageQueue() override = default; void init(const sp& flinger) override; - void setEventThread(android::EventThread* events, ResyncCallback resyncCallback) override; void setEventConnection(const sp& connection) override; void waitMessage() override; diff --git a/services/surfaceflinger/Scheduler/Scheduler.cpp b/services/surfaceflinger/Scheduler/Scheduler.cpp index add56fcd04..d60e101fb4 100644 --- a/services/surfaceflinger/Scheduler/Scheduler.cpp +++ b/services/surfaceflinger/Scheduler/Scheduler.cpp @@ -41,6 +41,7 @@ #include "DispSyncSource.h" #include "EventControlThread.h" #include "EventThread.h" +#include "InjectVSyncSource.h" #include "OneShotTimer.h" #include "SchedulerUtils.h" #include "SurfaceFlingerProperties.h" @@ -116,11 +117,20 @@ DispSync& Scheduler::getPrimaryDispSync() { return *mPrimaryDispSync; } +std::unique_ptr Scheduler::makePrimaryDispSyncSource( + const char* name, nsecs_t phaseOffsetNs, nsecs_t offsetThresholdForNextVsync) { + return std::make_unique(mPrimaryDispSync.get(), phaseOffsetNs, + offsetThresholdForNextVsync, true /* traceVsync */, + name); +} + Scheduler::ConnectionHandle Scheduler::createConnection( const char* connectionName, nsecs_t phaseOffsetNs, nsecs_t offsetThresholdForNextVsync, impl::EventThread::InterceptVSyncsCallback interceptCallback) { - auto eventThread = makeEventThread(connectionName, phaseOffsetNs, offsetThresholdForNextVsync, - std::move(interceptCallback)); + auto vsyncSource = + makePrimaryDispSyncSource(connectionName, phaseOffsetNs, offsetThresholdForNextVsync); + auto eventThread = std::make_unique(std::move(vsyncSource), + std::move(interceptCallback)); return createConnection(std::move(eventThread)); } @@ -135,16 +145,6 @@ Scheduler::ConnectionHandle Scheduler::createConnection(std::unique_ptr Scheduler::makeEventThread( - const char* connectionName, nsecs_t phaseOffsetNs, nsecs_t offsetThresholdForNextVsync, - impl::EventThread::InterceptVSyncsCallback&& interceptCallback) { - auto source = std::make_unique(mPrimaryDispSync.get(), phaseOffsetNs, - offsetThresholdForNextVsync, - true /* traceVsync */, connectionName); - return std::make_unique(std::move(source), std::move(interceptCallback), - connectionName); -} - sp Scheduler::createConnectionInternal( EventThread* eventThread, ISurfaceComposer::ConfigChanged configChanged) { return eventThread->createEventConnection([&] { resync(); }, configChanged); @@ -156,11 +156,6 @@ sp Scheduler::createDisplayEventConnection( return createConnectionInternal(mConnections[handle].thread.get(), configChanged); } -EventThread* Scheduler::getEventThread(ConnectionHandle handle) { - RETURN_IF_INVALID_HANDLE(handle, nullptr); - return mConnections[handle].thread.get(); -} - sp Scheduler::getEventConnection(ConnectionHandle handle) { RETURN_IF_INVALID_HANDLE(handle, nullptr); return mConnections[handle].connection; @@ -203,6 +198,37 @@ void Scheduler::getDisplayStatInfo(DisplayStatInfo* stats) { stats->vsyncPeriod = mPrimaryDispSync->getPeriod(); } +Scheduler::ConnectionHandle Scheduler::enableVSyncInjection(bool enable) { + if (mInjectVSyncs == enable) { + return {}; + } + + ALOGV("%s VSYNC injection", enable ? "Enabling" : "Disabling"); + + if (!mInjectorConnectionHandle) { + auto vsyncSource = std::make_unique(); + mVSyncInjector = vsyncSource.get(); + + auto eventThread = + std::make_unique(std::move(vsyncSource), + impl::EventThread::InterceptVSyncsCallback()); + + mInjectorConnectionHandle = createConnection(std::move(eventThread)); + } + + mInjectVSyncs = enable; + return mInjectorConnectionHandle; +} + +bool Scheduler::injectVSync(nsecs_t when) { + if (!mInjectVSyncs || !mVSyncInjector) { + return false; + } + + mVSyncInjector->onInjectSyncEvent(when); + return true; +} + void Scheduler::enableHardwareVsync() { std::lock_guard lock(mHWVsyncLock); if (!mPrimaryHWVsyncEnabled && mHWVsyncAvailable) { diff --git a/services/surfaceflinger/Scheduler/Scheduler.h b/services/surfaceflinger/Scheduler/Scheduler.h index 0c8c335bf6..a5971fed23 100644 --- a/services/surfaceflinger/Scheduler/Scheduler.h +++ b/services/surfaceflinger/Scheduler/Scheduler.h @@ -36,6 +36,7 @@ namespace android { class DispSync; class FenceTime; +class InjectVSyncSource; struct DisplayStateInfo; class Scheduler { @@ -63,7 +64,6 @@ public: sp createDisplayEventConnection(ConnectionHandle, ISurfaceComposer::ConfigChanged); - EventThread* getEventThread(ConnectionHandle); sp getEventConnection(ConnectionHandle); void onHotplugReceived(ConnectionHandle, PhysicalDisplayId, bool connected); @@ -77,6 +77,12 @@ public: void getDisplayStatInfo(DisplayStatInfo* stats); + // Returns injector handle if injection has toggled, or an invalid handle otherwise. + ConnectionHandle enableVSyncInjection(bool enable); + + // Returns false if injection is disabled. + bool injectVSync(nsecs_t when); + void enableHardwareVsync(); void disableHardwareVsync(bool makeUnavailable); @@ -138,12 +144,10 @@ private: Scheduler(std::unique_ptr, std::unique_ptr, const scheduler::RefreshRateConfigs&); - // Creates a connection on the given EventThread and forwards the given callbacks. - std::unique_ptr makeEventThread(const char* connectionName, nsecs_t phaseOffsetNs, - nsecs_t offsetThresholdForNextVsync, - impl::EventThread::InterceptVSyncsCallback&&); + std::unique_ptr makePrimaryDispSyncSource(const char* name, nsecs_t phaseOffsetNs, + nsecs_t offsetThresholdForNextVsync); - // Create a connection on the given EventThread and forward the resync callback. + // Create a connection on the given EventThread. ConnectionHandle createConnection(std::unique_ptr); sp createConnectionInternal(EventThread*, ISurfaceComposer::ConfigChanged); @@ -173,6 +177,10 @@ private: ConnectionHandle::Id mNextConnectionHandleId = 0; std::unordered_map mConnections; + bool mInjectVSyncs = false; + InjectVSyncSource* mVSyncInjector = nullptr; + ConnectionHandle mInjectorConnectionHandle; + std::mutex mHWVsyncLock; bool mPrimaryHWVsyncEnabled GUARDED_BY(mHWVsyncLock) = false; bool mHWVsyncAvailable GUARDED_BY(mHWVsyncLock) = false; diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index c01d3aaa3b..c1373bbcb4 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -104,7 +104,6 @@ #include "Scheduler/DispSyncSource.h" #include "Scheduler/EventControlThread.h" #include "Scheduler/EventThread.h" -#include "Scheduler/InjectVSyncSource.h" #include "Scheduler/MessageQueue.h" #include "Scheduler/PhaseOffsets.h" #include "Scheduler/Scheduler.h" @@ -1193,48 +1192,20 @@ status_t SurfaceFlinger::isWideColorDisplay(const sp& displayToken, status_t SurfaceFlinger::enableVSyncInjections(bool enable) { postMessageSync(new LambdaMessage([&] { - Mutex::Autolock _l(mStateLock); - - if (mInjectVSyncs == enable) { - return; - } + Mutex::Autolock lock(mStateLock); - // TODO(b/128863962): Part of the Injector should be refactored, so that it - // can be passed to Scheduler. - if (enable) { - ALOGV("VSync Injections enabled"); - if (mVSyncInjector.get() == nullptr) { - mVSyncInjector = std::make_unique(); - mInjectorEventThread = std::make_unique< - impl::EventThread>(mVSyncInjector.get(), - impl::EventThread::InterceptVSyncsCallback(), - "injEventThread"); - } - mEventQueue->setEventThread(mInjectorEventThread.get(), [&] { mScheduler->resync(); }); - } else { - ALOGV("VSync Injections disabled"); - mEventQueue->setEventThread(mScheduler->getEventThread(mSfConnectionHandle), - [&] { mScheduler->resync(); }); + if (const auto handle = mScheduler->enableVSyncInjection(enable)) { + mEventQueue->setEventConnection( + mScheduler->getEventConnection(enable ? handle : mSfConnectionHandle)); } - - mInjectVSyncs = enable; })); return NO_ERROR; } status_t SurfaceFlinger::injectVSync(nsecs_t when) { - Mutex::Autolock _l(mStateLock); - - if (!mInjectVSyncs) { - ALOGE("VSync Injections not enabled"); - return BAD_VALUE; - } - if (mInjectVSyncs && mInjectorEventThread.get() != nullptr) { - ALOGV("Injecting VSync inside SurfaceFlinger"); - mVSyncInjector->onInjectSyncEvent(when); - } - return NO_ERROR; + Mutex::Autolock lock(mStateLock); + return mScheduler->injectVSync(when) ? NO_ERROR : BAD_VALUE; } status_t SurfaceFlinger::getLayerDebugInfo(std::vector* outLayers) const diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index aaa50f61a0..8157109be6 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -89,7 +89,6 @@ class EventThread; class HWComposer; class IGraphicBufferProducer; class IInputFlinger; -class InjectVSyncSource; class Layer; class MessageBase; class RefreshRateOverlay; @@ -932,8 +931,6 @@ private: // constant members (no synchronization needed for access) const nsecs_t mBootTime = systemTime(); bool mGpuToCpuSupported = false; - std::unique_ptr mInjectorEventThread; - std::unique_ptr mVSyncInjector; // Can only accessed from the main thread, these members // don't need synchronization @@ -1048,8 +1045,6 @@ private: * Feature prototyping */ - bool mInjectVSyncs = false; - // Static screen stats bool mHasPoweredOff = false; diff --git a/services/surfaceflinger/tests/unittests/EventThreadTest.cpp b/services/surfaceflinger/tests/unittests/EventThreadTest.cpp index dbd9b84039..2662f52581 100644 --- a/services/surfaceflinger/tests/unittests/EventThreadTest.cpp +++ b/services/surfaceflinger/tests/unittests/EventThreadTest.cpp @@ -42,6 +42,8 @@ constexpr PhysicalDisplayId DISPLAY_ID_64BIT = 0xabcd12349876fedcULL; class MockVSyncSource : public VSyncSource { public: + const char* getName() const override { return "test"; } + MOCK_METHOD1(setVSyncEnabled, void(bool)); MOCK_METHOD1(setCallback, void(VSyncSource::Callback*)); MOCK_METHOD1(setPhaseOffset, void(nsecs_t)); @@ -54,8 +56,7 @@ class EventThreadTest : public testing::Test { protected: class MockEventThreadConnection : public EventThreadConnection { public: - MockEventThreadConnection(android::impl::EventThread* eventThread, - ResyncCallback&& resyncCallback, + MockEventThreadConnection(impl::EventThread* eventThread, ResyncCallback&& resyncCallback, ISurfaceComposer::ConfigChanged configChanged) : EventThreadConnection(eventThread, std::move(resyncCallback), configChanged) {} MOCK_METHOD1(postEvent, status_t(const DisplayEventReceiver::Event& event)); @@ -67,7 +68,7 @@ protected: EventThreadTest(); ~EventThreadTest() override; - void createThread(); + void createThread(std::unique_ptr); sp createConnection(ConnectionEventRecorder& recorder, ISurfaceComposer::ConfigChanged configChanged); @@ -91,9 +92,9 @@ protected: AsyncCallRecorder mInterceptVSyncCallRecorder; ConnectionEventRecorder mConnectionEventCallRecorder{0}; - MockVSyncSource mVSyncSource; + MockVSyncSource* mVSyncSource; VSyncSource::Callback* mCallback = nullptr; - std::unique_ptr mThread; + std::unique_ptr mThread; sp mConnection; }; @@ -102,16 +103,19 @@ EventThreadTest::EventThreadTest() { ::testing::UnitTest::GetInstance()->current_test_info(); ALOGD("**** Setting up for %s.%s\n", test_info->test_case_name(), test_info->name()); - EXPECT_CALL(mVSyncSource, setVSyncEnabled(_)) + auto vsyncSource = std::make_unique(); + mVSyncSource = vsyncSource.get(); + + EXPECT_CALL(*mVSyncSource, setVSyncEnabled(_)) .WillRepeatedly(Invoke(mVSyncSetEnabledCallRecorder.getInvocable())); - EXPECT_CALL(mVSyncSource, setCallback(_)) + EXPECT_CALL(*mVSyncSource, setCallback(_)) .WillRepeatedly(Invoke(mVSyncSetCallbackCallRecorder.getInvocable())); - EXPECT_CALL(mVSyncSource, setPhaseOffset(_)) + EXPECT_CALL(*mVSyncSource, setPhaseOffset(_)) .WillRepeatedly(Invoke(mVSyncSetPhaseOffsetCallRecorder.getInvocable())); - createThread(); + createThread(std::move(vsyncSource)); mConnection = createConnection(mConnectionEventCallRecorder, ISurfaceComposer::eConfigChangedDispatch); @@ -129,11 +133,9 @@ EventThreadTest::~EventThreadTest() { EXPECT_TRUE(!mVSyncSetCallbackCallRecorder.waitForUnexpectedCall().has_value()); } -void EventThreadTest::createThread() { - mThread = - std::make_unique(&mVSyncSource, - mInterceptVSyncCallRecorder.getInvocable(), - "unit-test-event-thread"); +void EventThreadTest::createThread(std::unique_ptr source) { + mThread = std::make_unique(std::move(source), + mInterceptVSyncCallRecorder.getInvocable()); // EventThread should register itself as VSyncSource callback. mCallback = expectVSyncSetCallbackCallReceived(); diff --git a/services/surfaceflinger/tests/unittests/SchedulerTest.cpp b/services/surfaceflinger/tests/unittests/SchedulerTest.cpp index bf531248f8..b4cc1e15e8 100644 --- a/services/surfaceflinger/tests/unittests/SchedulerTest.cpp +++ b/services/surfaceflinger/tests/unittests/SchedulerTest.cpp @@ -92,7 +92,6 @@ TEST_F(SchedulerTest, invalidConnectionHandle) { ISurfaceComposer:: eConfigChangedSuppress)); EXPECT_FALSE(connection); - EXPECT_FALSE(mScheduler->getEventThread(handle)); EXPECT_FALSE(mScheduler->getEventConnection(handle)); // The EXPECT_CALLS make sure we don't call the functions on the subsequent event threads. @@ -121,8 +120,6 @@ TEST_F(SchedulerTest, validConnectionHandle) { ISurfaceComposer:: eConfigChangedSuppress)); ASSERT_EQ(mEventThreadConnection, connection); - - EXPECT_TRUE(mScheduler->getEventThread(mConnectionHandle)); EXPECT_TRUE(mScheduler->getEventConnection(mConnectionHandle)); EXPECT_CALL(*mEventThread, onHotplugReceived(PHYSICAL_DISPLAY_ID, false)).Times(1); diff --git a/services/surfaceflinger/tests/unittests/mock/MockMessageQueue.h b/services/surfaceflinger/tests/unittests/mock/MockMessageQueue.h index 1b1c1a7990..e781c0a10d 100644 --- a/services/surfaceflinger/tests/unittests/mock/MockMessageQueue.h +++ b/services/surfaceflinger/tests/unittests/mock/MockMessageQueue.h @@ -30,7 +30,6 @@ public: ~MessageQueue() override; MOCK_METHOD1(init, void(const sp&)); - MOCK_METHOD2(setEventThread, void(android::EventThread*, ResyncCallback)); MOCK_METHOD1(setEventConnection, void(const sp& connection)); MOCK_METHOD0(waitMessage, void()); MOCK_METHOD2(postMessage, status_t(const sp&, nsecs_t)); -- cgit v1.2.3-59-g8ed1b