Synthesize fake vsyncs when the screen is off.
When the screen is off, we might not receive real vsync pulses from the hardware which would cause posted Choreographer callbacks to not run. This is bad because messages in the Looper might be blocked behind a barrier that is scheduled to be removed by one of those Choreographer callback (see ViewRootImpl.doTraversals). Until the barrier is removed, those messages will not run. To prevent starvation of the Looper, we synthesize fake vsync pulses at a reduced rate whenever the display hardware stops generating them. This change should fix a variety of rare non-deterministic bugs where the system might appear to be unresponsive while the screen is off, and spurious ANRs reported shortly after the screen is turned back on. Bug: 6574842 Bug: 6636995 Bug: 6643559 Change-Id: I263f2fdf979afd79e5ac47a0cc5d34a93b860c21
Loading
Please register or sign in to comment