diff options
author | Ady Abraham <adyabr@google.com> | 2019-05-08 14:50:56 -0700 |
---|---|---|
committer | Ady Abraham <adyabr@google.com> | 2019-05-17 17:12:15 +0000 |
commit | 8532d011118e863229bbbd78e247d11325ecbe6c (patch) | |
tree | 9621f9953b535d9d57fcb3b83a67b3e6b1dc6573 /services/surfaceflinger/tests/unittests/EventThreadTest.cpp | |
parent | df542f63e1df9f5af21f683ec049646ab0c13711 (diff) |
SurfaceFlinger: Add touch events to Scheduler
Add the notion of Touch Events to Scheduler to enhance the algorithm
to move to Performance refresh rate.
Scheduler selects Performance when:
- There is a touch event
- There is a buffer to HWC
This change also removes the behavior of Scheduler to move to Performance
on Choreographer callbacks.
Test: Switch between apps using gesture navigation
Bug: 131906818
Change-Id: I588cfc32449e87744e829dc7c5261a2e4151a8f8
Diffstat (limited to 'services/surfaceflinger/tests/unittests/EventThreadTest.cpp')
-rw-r--r-- | services/surfaceflinger/tests/unittests/EventThreadTest.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/services/surfaceflinger/tests/unittests/EventThreadTest.cpp b/services/surfaceflinger/tests/unittests/EventThreadTest.cpp index 83a92c8691..ea908a9018 100644 --- a/services/surfaceflinger/tests/unittests/EventThreadTest.cpp +++ b/services/surfaceflinger/tests/unittests/EventThreadTest.cpp @@ -55,10 +55,8 @@ protected: class MockEventThreadConnection : public EventThreadConnection { public: MockEventThreadConnection(android::impl::EventThread* eventThread, - ResyncCallback&& resyncCallback, - ResetIdleTimerCallback&& resetIdleTimerCallback) - : EventThreadConnection(eventThread, std::move(resyncCallback), - std::move(resetIdleTimerCallback)) {} + ResyncCallback&& resyncCallback) + : EventThreadConnection(eventThread, std::move(resyncCallback)) {} MOCK_METHOD1(postEvent, status_t(const DisplayEventReceiver::Event& event)); }; @@ -88,7 +86,6 @@ protected: AsyncCallRecorder<void (*)(VSyncSource::Callback*)> mVSyncSetCallbackCallRecorder; AsyncCallRecorder<void (*)(nsecs_t)> mVSyncSetPhaseOffsetCallRecorder; AsyncCallRecorder<void (*)()> mResyncCallRecorder; - AsyncCallRecorder<void (*)()> mResetIdleTimerCallRecorder; AsyncCallRecorder<void (*)(nsecs_t)> mInterceptVSyncCallRecorder; ConnectionEventRecorder mConnectionEventCallRecorder{0}; @@ -143,8 +140,7 @@ void EventThreadTest::createThread() { sp<EventThreadTest::MockEventThreadConnection> EventThreadTest::createConnection( ConnectionEventRecorder& recorder) { sp<MockEventThreadConnection> connection = - new MockEventThreadConnection(mThread.get(), mResyncCallRecorder.getInvocable(), - mResetIdleTimerCallRecorder.getInvocable()); + new MockEventThreadConnection(mThread.get(), mResyncCallRecorder.getInvocable()); EXPECT_CALL(*connection, postEvent(_)).WillRepeatedly(Invoke(recorder.getInvocable())); return connection; } @@ -225,7 +221,6 @@ TEST_F(EventThreadTest, canCreateAndDestroyThreadWithNoEventsSent) { EXPECT_FALSE(mVSyncSetCallbackCallRecorder.waitForCall(0us).has_value()); EXPECT_FALSE(mVSyncSetPhaseOffsetCallRecorder.waitForCall(0us).has_value()); EXPECT_FALSE(mResyncCallRecorder.waitForCall(0us).has_value()); - EXPECT_FALSE(mResetIdleTimerCallRecorder.waitForCall(0us).has_value()); EXPECT_FALSE(mInterceptVSyncCallRecorder.waitForCall(0us).has_value()); EXPECT_FALSE(mConnectionEventCallRecorder.waitForCall(0us).has_value()); } @@ -235,7 +230,7 @@ TEST_F(EventThreadTest, vsyncRequestIsIgnoredIfDisplayIsDisconnected) { expectHotplugEventReceivedByConnection(INTERNAL_DISPLAY_ID, false); // Signal that we want the next vsync event to be posted to the connection. - mThread->requestNextVsync(mConnection, false); + mThread->requestNextVsync(mConnection); // EventThread should not enable vsync callbacks. EXPECT_FALSE(mVSyncSetEnabledCallRecorder.waitForUnexpectedCall().has_value()); @@ -243,10 +238,9 @@ TEST_F(EventThreadTest, vsyncRequestIsIgnoredIfDisplayIsDisconnected) { TEST_F(EventThreadTest, requestNextVsyncPostsASingleVSyncEventToTheConnection) { // Signal that we want the next vsync event to be posted to the connection - mThread->requestNextVsync(mConnection, true); + mThread->requestNextVsync(mConnection); - // EventThread should immediately reset the idle timer and request a resync. - EXPECT_TRUE(mResetIdleTimerCallRecorder.waitForCall().has_value()); + // EventThread should immediately request a resync. EXPECT_TRUE(mResyncCallRecorder.waitForCall().has_value()); // EventThread should enable vsync callbacks. |