OSDN Git Service

surfaceflinger: make vsync injection more robust
authorChia-I Wu <olv@google.com>
Thu, 5 Oct 2017 21:24:41 +0000 (14:24 -0700)
committerChia-I Wu <olv@google.com>
Fri, 27 Oct 2017 18:01:34 +0000 (11:01 -0700)
commit6200eacdc927776483d775562db11cce284cc7e0
tree423759657354625c41872525fa093adab8cbb4a6
parent6afce442eadb3b26d582815e7e14c93e3f487068
surfaceflinger: make vsync injection more robust

There are more issues than I expected :)

 - no lock to synchronize enable/disable and injection
 - Every time injection is diabled and enabled, a new EventThread is
   created
 - mCallback might be nullptr
 - ENABLE_VSYNC_INJECTIONS/INJECT_VSYNC should require special
   permission
 - MessageQueue::setEventThread must be called from the main thread
 - MessageQueue::setEventThread does not handle EventThread switch
   well

Bug: 65483324
Test: manual
Merged-In: I7d7b98d1f57afc64af0f2065a9bc7c8ad004ca9f
Change-Id: I7d7b98d1f57afc64af0f2065a9bc7c8ad004ca9f
services/surfaceflinger/MessageQueue.cpp
services/surfaceflinger/SurfaceFlinger.cpp
services/surfaceflinger/SurfaceFlinger.h