Don't show low battery tip when estimation is zero
It means invalid when estimation is zero. We should catch this case int LowBatteryDetector and don't show it. Change-Id: I01dd50616f54162a6688257f4bdb329dfa351bc5 Fixes: 110226028 Test: RunSettingsRoboTests
This commit is contained in:
@@ -105,6 +105,13 @@ public class LowBatteryDetectorTest {
|
||||
assertThat(mLowBatteryDetector.detect().isVisible()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDetect_timeEstimationZero_tipInvisible() {
|
||||
mBatteryInfo.batteryLevel = 50;
|
||||
mBatteryInfo.remainingTimeUs = 0;
|
||||
assertThat(mLowBatteryDetector.detect().isVisible()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDetect_noEarlyWarning_tipInvisible() {
|
||||
mBatteryInfo.remainingTimeUs = TimeUnit.DAYS.toMicros(1);
|
||||
|
Reference in New Issue
Block a user