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)
committerandroid-build-team Robot <android-build-team-robot@google.com>
Tue, 28 Nov 2017 03:32:51 +0000 (03:32 +0000)
commit16392a119661fd1da750d4d4e8e03442578bc543
treefb5418f4470abed437b67a63b41221d1353dc330
parentf2b791587c15ec5028d0b266d415c631a4078916
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
(cherry picked from commit 6200eacdc927776483d775562db11cce284cc7e0)
services/surfaceflinger/MessageQueue.cpp
services/surfaceflinger/SurfaceFlinger.cpp
services/surfaceflinger/SurfaceFlinger.h