Disabling user activity now resets user power state so the keyguard can set short screen timeout when keyguard is unhidden.
This is part of a fix for bug b/2248320 (Lock screen does not time out after
Change-Id: Iba7f8a7b9997ecb0e4da37667600055f9a35531c
Signed-off-by: Mike Lockwood <lockwood@android.com>
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index dd4a630..3000e9d 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -2106,10 +2106,19 @@
/**
* When the keyguard is up, it manages the power state, and userActivity doesn't do anything.
+ * When disabling user activity we also reset user power state so the keyguard can reset its
+ * short screen timeout when keyguard is unhidden.
*/
public void enableUserActivity(boolean enabled) {
+ if (mSpew) {
+ Log.d(TAG, "enableUserActivity " + enabled);
+ }
synchronized (mLocks) {
mUserActivityAllowed = enabled;
+ if (!enabled) {
+ // cancel timeout and clear mUserState so the keyguard can set a short timeout
+ setTimeoutLocked(SystemClock.uptimeMillis(), 0);
+ }
}
}