OSDN Git Service

PowerManagerService: fix HW button illumination timeout
authorCorinna Vinschen <xda@vinschen.de>
Sun, 6 Aug 2017 13:05:54 +0000 (15:05 +0200)
committerCorinna Vinschen <xda@vinschen.de>
Wed, 9 Aug 2017 20:47:06 +0000 (22:47 +0200)
commitadedad8c54a4407b30fc6b28495cf6ef6286aa2e
treeb56fdfee49e5273031a39793194a65ebcc68feab
parentd20e02270d9d00bb0752c5645880812f124e3b8b
PowerManagerService: fix HW button illumination timeout

Patch 20a3c7c4e823a89e428997a1c2771c0c4f1d4684, introducing hardware
button backlight on button keypress only, also introduced a bug:

When touching a button and then performing display activity while
the buttons are still on, the buttons would keep lightened up until
the next user interaction, potentially only switched off at the next
screen off timeout.  Also, the buttons were not illuminated on
device wakeup.

This patch fixes it, together with another, long-standing problem:

When touching a hardware button, nextTimeout was set to
now + mButtonTimeout, even if mButtonTimeout is longer than the timeout
determined by the screen off timeout.  To wit, if screen timeout is set
to 15 secs, but button timeout to values > 15 secs.

Change-Id: I8a56f1d1e0138c38ed6fe294e4816a9f7f744f1e
Signed-off-by: Corinna Vinschen <xda@vinschen.de>
services/core/java/com/android/server/power/PowerManagerService.java