OSDN Git Service

Don't dispatch when non-interactive and the display is off.
authorMichael Wright <michaelwr@google.com>
Tue, 4 Aug 2015 22:03:03 +0000 (23:03 +0100)
committerMichael Wright <michaelwr@google.com>
Tue, 4 Aug 2015 22:17:48 +0000 (23:17 +0100)
commit2ccf0c8e636fd3be75c3a07f4cf60d72a4cfaa28
tree8953d8bcdaae395d3aabb17f92146a6475837a03
parentfc5a4bf0e1520bf3acd75226d760b8e1d7cdd59f
Don't dispatch when non-interactive and the display is off.

We generally dispatch while the display is off and we're dozing,
under the assumption that the dozing window is controlling the
display state and wants the events as they come in. Unfortunately,
it's possible that we're dozing but something other than the dozing
component has focus, which leads to dropped and cancelled events.
This was preventing media events from being propogated to the media
session under a number of scenarios, so for now we'll just prevent
dispatching entirely while the display is off and the device is in a
non-interactive state. Going forward we should figure out a better
solution so that doze components can continue to receiving input
events throughout their lifecycle, regardless of the display state.

Bug: 22422588
Change-Id: Ia38bd81245234743e84548841d6478f75a6b8775
services/core/java/com/android/server/policy/PhoneWindowManager.java