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

Commit 290496e9 authored by Salvador Martinez's avatar Salvador Martinez
Browse files

Fix mixed up variable in triggering logic

When this code got refactored the check for severe warnings
accidentally had the time remaining being compared against the percentage
value of the severe warning threshold. Unfortunately this meant that
it was impossible to mark the severe level warning as shown and could
result in multiple triggerings. This change makes it so everything
is compared with the appropriate type of value again.

Test: PowerUI Tests pass
Bug: 129730217
Change-Id: Ic8bdabf1c70e49d117210bb80f1ca0a0d7684617
parent e320cdb4
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -341,8 +341,9 @@ public class PowerUI extends SystemUI {
            // mark if we've already shown a warning this cycle. This will prevent the notification
            // trigger from spamming users by only showing low/critical warnings once per cycle
            if (currentSnapshot.getTimeRemainingMillis()
                    <= currentSnapshot.getSevereLevelThreshold()
                    || currentSnapshot.getBatteryLevel() <= mLowBatteryReminderLevels[1]) {
                    <= currentSnapshot.getSevereThresholdMillis()
                    || currentSnapshot.getBatteryLevel()
                    <= currentSnapshot.getSevereLevelThreshold()) {
                mSevereWarningShownThisChargeCycle = true;
                mLowWarningShownThisChargeCycle = true;
                if (DEBUG) {