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

Commit 3250e92e authored by YK Hung's avatar YK Hung Committed by Android (Google) Code Review
Browse files

Merge "Make isPowerPluggedIn a method for flexibility." into main

parents 362d4ac4 45de7bc6
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1276,7 +1276,7 @@ public class KeyguardIndicationController {
            mPowerPluggedInWired = status.isPluggedInWired() && isChargingOrFull;
            mPowerPluggedInWireless = status.isPluggedInWireless() && isChargingOrFull;
            mPowerPluggedInDock = status.isPluggedInDock() && isChargingOrFull;
            mPowerPluggedIn = status.isPluggedIn() && isChargingOrFull;
            mPowerPluggedIn = isPowerPluggedIn(status, isChargingOrFull);
            mPowerCharged = status.isCharged();
            mChargingWattage = status.maxChargingWattage;
            mChargingSpeed = status.getChargingSpeed(mContext);
@@ -1562,6 +1562,11 @@ public class KeyguardIndicationController {
        return status.isBatteryDefender();
    }

    /** Return true if the device has power plugged in. */
    protected boolean isPowerPluggedIn(BatteryStatus status, boolean isChargingOrFull) {
        return status.isPluggedIn() && isChargingOrFull;
    }

    private boolean isCurrentUser(int userId) {
        return getCurrentUser() == userId;
    }