diff options
| author | 2010-03-01 21:28:58 -0500 | |
|---|---|---|
| committer | 2010-03-01 21:28:58 -0500 | |
| commit | 84a893467307eb3178b99a7926dea9c8e21579f1 (patch) | |
| tree | 2cc0f89c239e8f86d33cdab1869d5080dc132a41 | |
| parent | 42c79880b0c19dfbcd8589d89d35fcedb1a7c9da (diff) | |
Don't poke user activity when unplugging unless screen is already on.
Change-Id: I5a5f233541e13b3a916ad0d8b3bf8d6fb49ab7fd
BUG: 1317687
Signed-off-by: Mike Lockwood <lockwood@android.com>
| -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(); + } } } } |