diff options
| author | 2019-04-04 10:30:19 -0700 | |
|---|---|---|
| committer | 2019-04-04 22:21:57 +0000 | |
| commit | 290496e94e35d1bc804aad4ef7f7d04ee5c86eea (patch) | |
| tree | 2736a71dd5b75a0e881918ddc2a6da2dcd5f34f5 | |
| parent | e320cdb4415d9e1fd42d8e0b2dd96be1088ae684 (diff) | |
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
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/power/PowerUI.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java index 4e41108f6496..25d6d940d92e 100644 --- a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java +++ b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java @@ -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) { |