From 3c9435a20597adec7ec2e110b92920b4a9ecb0e7 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Thu, 22 Oct 2009 15:45:37 -0400 Subject: [PATCH] PowerManager: Don't poke user activity in setKeyboardVisibility unless the state actually changed. Fixes bug b/2158297 (lock screen should time out after 7 seconds) Change-Id: Ia3f7ef6464129ab78283923dbfd7f7472136e676 Signed-off-by: Mike Lockwood --- .../com/android/server/PowerManagerService.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java index 29a5ba85ae64c..b0c5950903fee 100644 --- a/services/java/com/android/server/PowerManagerService.java +++ b/services/java/com/android/server/PowerManagerService.java @@ -2007,12 +2007,14 @@ class PowerManagerService extends IPowerManager.Stub if (mSpew) { Log.d(TAG, "setKeyboardVisibility: " + visible); } - mKeyboardVisible = visible; - // don't signal user activity if the screen is off; other code - // will take care of turning on due to a true change to the lid - // switch and synchronized with the lock screen. - if ((mPowerState & SCREEN_ON_BIT) != 0) { - userActivity(SystemClock.uptimeMillis(), false, BUTTON_EVENT, true); + if (mKeyboardVisible != visible) { + mKeyboardVisible = visible; + // don't signal user activity if the screen is off; other code + // will take care of turning on due to a true change to the lid + // switch and synchronized with the lock screen. + if ((mPowerState & SCREEN_ON_BIT) != 0) { + userActivity(SystemClock.uptimeMillis(), false, BUTTON_EVENT, true); + } } } }