Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit debecf2e authored by Mike Lockwood's avatar Mike Lockwood Committed by Android (Google) Code Review
Browse files

Merge "Don't poke user activity when unplugging unless screen is already on."

parents 0ef3eeec 84a89346
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -349,15 +349,19 @@ 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) {
                        if (!wasPowered || (mPowerState & SCREEN_ON_BIT) != 0) {
                            forceUserActivityLocked();
                        }
                    }
                }
            }
        }
    }

    private final class BootCompletedReceiver extends BroadcastReceiver {
        @Override