diff options
| author | 2010-03-02 04:29:04 -0800 | |
|---|---|---|
| committer | 2010-03-02 04:29:04 -0800 | |
| commit | debecf2e4094f7a901632286d3f45ea2211e7494 (patch) | |
| tree | c5278de8e38dc69a090207029acacfadb03a4e4c | |
| parent | 0ef3eeec405efe2585eae8e675869dafdf81698f (diff) | |
| parent | 84a893467307eb3178b99a7926dea9c8e21579f1 (diff) | |
Merge "Don't poke user activity when unplugging unless screen is already on."
| -rw-r--r-- | services/java/com/android/server/PowerManagerService.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java index d3efa1222dab..11b966ee87ef 100644 --- a/services/java/com/android/server/PowerManagerService.java +++ b/services/java/com/android/server/PowerManagerService.java @@ -349,10 +349,14 @@ class PowerManagerService extends IPowerManager.Stub // treat plugging and unplugging the devices as a user activity. // users find it disconcerting when they unplug the device // and it shuts off right away. + // to avoid turning on the screen when unplugging, we only trigger + // user activity when screen was already on. // temporarily set mUserActivityAllowed to true so this will work // even when the keyguard is on. synchronized (mLocks) { - forceUserActivityLocked(); + if (!wasPowered || (mPowerState & SCREEN_ON_BIT) != 0) { + forceUserActivityLocked(); + } } } } |