Fix the battery icon on the battery page when low battery

Check power-saving state for drawing the battery icon on the battery page.
It will draw red + icon as status-bar did when battery saver is on.

Change-Id: Iee4a17c8e5cb3c8ee5d978eb23e3980597d09a1c
Fixes: 77150820
Test: Manual test, atest BatteryMeterViewTest BatteryHeaderPreferenceControllerTest
This commit is contained in:
Weien Wang
2018-05-21 12:10:11 +08:00
parent 429c787168
commit 27e9617c16
4 changed files with 42 additions and 1 deletions

View File

@@ -86,4 +86,11 @@ public class BatteryMeterViewTest {
verify(mDrawable).setBatteryColorFilter(mAccentColorFilter);
}
@Test
public void testSetBatteryInfo_powerSave_setCorrectly() {
mBatteryMeterView.setPowerSave(true);
assertThat(mBatteryMeterView.getPowerSave()).isEqualTo(true);
}
}