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>
This commit is contained in:
@@ -2106,10 +2106,19 @@ class PowerManagerService extends IPowerManager.Stub
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* When the keyguard is up, it manages the power state, and userActivity doesn't do anything.
|
* 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) {
|
public void enableUserActivity(boolean enabled) {
|
||||||
|
if (mSpew) {
|
||||||
|
Log.d(TAG, "enableUserActivity " + enabled);
|
||||||
|
}
|
||||||
synchronized (mLocks) {
|
synchronized (mLocks) {
|
||||||
mUserActivityAllowed = enabled;
|
mUserActivityAllowed = enabled;
|
||||||
|
if (!enabled) {
|
||||||
|
// cancel timeout and clear mUserState so the keyguard can set a short timeout
|
||||||
|
setTimeoutLocked(SystemClock.uptimeMillis(), 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user