simplify further vsync handling
- we now clean-up "dead" connection in the main loop,
this entirely avoid the problem with the side effects of
releasing strong references. We now only hold on to strong
reference for the connection we will signal.
- also simplify how we build the list of "ready" connections, by
only adding them to the list when we did receive a vsync event
Change-Id: I2a84da431320a2af8e8a93e07622a1d258236f43
diff --git a/services/surfaceflinger/EventThread.h b/services/surfaceflinger/EventThread.h
index aa0ea7f..20ea34d 100644
--- a/services/surfaceflinger/EventThread.h
+++ b/services/surfaceflinger/EventThread.h
@@ -65,7 +65,6 @@
sp<Connection> createEventConnection() const;
status_t registerDisplayEventConnection(const sp<Connection>& connection);
- status_t unregisterDisplayEventConnection(const wp<Connection>& connection);
void setVsyncRate(uint32_t count, const sp<Connection>& connection);
void requestNextVsync(const sp<Connection>& connection);
@@ -79,6 +78,9 @@
// called when receiving a vsync event
void onVSyncReceived(int display, nsecs_t timestamp);
+ Vector< sp<EventThread::Connection> > waitForEvent(
+ DisplayEventReceiver::Event* event);
+
void dump(String8& result, char* buffer, size_t SIZE) const;
private: