SurfaceFlinger: add explicit register for DISPLAY_EVENT_CONFIG_CHANGED
When display refresh rate changes, SF fires DISPLAY_EVENT_CONFIG_CHANGED
thru DisplayEventReceiver. If the other end of the pipe doesn't consume
the events it may lead to pipe full and dropping of events. Furthermore,
The only clients interested in this event in DisplayManager and hwui.
To avoid spamming all clients with this event, this change is adding an
explicit register for DISPLAY_EVENT_CONFIG_CHANGED events.
Bug: 131688378
Test: adb shell /data/nativetest64/libsurfaceflinger_unittest/libsurfaceflinger_unittest
Test: trigger config change and observe logcat
Change-Id: I5973a1ecc1f3e3ff8d8a0cba19db0e49ef0d5341
diff --git a/services/surfaceflinger/Scheduler/Scheduler.h b/services/surfaceflinger/Scheduler/Scheduler.h
index f6cc87b..6b5a8b7 100644
--- a/services/surfaceflinger/Scheduler/Scheduler.h
+++ b/services/surfaceflinger/Scheduler/Scheduler.h
@@ -100,8 +100,9 @@
ResyncCallback,
impl::EventThread::InterceptVSyncsCallback);
- sp<IDisplayEventConnection> createDisplayEventConnection(const sp<ConnectionHandle>& handle,
- ResyncCallback);
+ sp<IDisplayEventConnection> createDisplayEventConnection(
+ const sp<ConnectionHandle>& handle, ResyncCallback,
+ ISurfaceComposer::ConfigChanged configChanged);
// Getter methods.
EventThread* getEventThread(const sp<ConnectionHandle>& handle);
@@ -197,7 +198,8 @@
enum class TouchState { INACTIVE, ACTIVE };
// Creates a connection on the given EventThread and forwards the given callbacks.
- sp<EventThreadConnection> createConnectionInternal(EventThread*, ResyncCallback&&);
+ sp<EventThreadConnection> createConnectionInternal(EventThread*, ResyncCallback&&,
+ ISurfaceComposer::ConfigChanged);
nsecs_t calculateAverage() const;
void updateFrameSkipping(const int64_t skipCount);