OSDN Git Service

Fix bugs related to cheek event suppression.
authorJeff Brown <jeffbrown@google.com>
Tue, 2 Nov 2010 03:35:46 +0000 (20:35 -0700)
committerJeff Brown <jeffbrown@google.com>
Tue, 2 Nov 2010 03:51:58 +0000 (20:51 -0700)
commita87ea46cb023763e0a9b0222da20b0a354f79d8d
treeaf391e4d3190d4023b6e5757a504346798151fc3
parent5dda76a72e8bb4630fb5fd38a42e7bceb5b9c954
Fix bugs related to cheek event suppression.

Two issues:

1. First, due to an inverted conditional in the input dispatcher, we were
   reporting touches as long touches and vice-versa to the power manager.

2. Power manager user activity cheek event suppression also suppresses touch
   events (but not long touch or up events).  As a result, if cheek event
   suppression was enabled, touches would not poke the user activity timer.
   However due to the above logic inversion, this actually affected long
   touches.  Net result, if cheek suppression was enabled in the power manager
   and you held your thumb on the screen long enough, the phone would
   go to sleep!

Cheek event suppression is commonly turned on when making a phone call.
Interestingly, it does not seem to get turned off afterward...

This change fixes the logic inversion and exempts touches from the cheek
suppression.  The reason we do the latter is because the old behavior
was actually harmful in other ways too: a touch down would be suppressed
but not a long touch or the touch up.  This would cause bizarre behavior
if you touched the screen while it was dimmed.  Instead of brightening
immediately, it would brighten either when you lifted your finger or
300ms later, whichever came first.

Bug: 3154895
Change-Id: Ied9ccec6718fbe86506322ff47a4e3eb58f81834
libs/ui/InputDispatcher.cpp
services/java/com/android/server/PowerManagerService.java