Don't hide 1% battery usage apps but show percentage "-" instead.
Bug b/242252864 will be fixed at the same time. screen_record: https://drive.google.com/open?id=1ycEuazqQZzNWGO8E2Fh3GdgyTEd2Z9s0&authuser=0&resourcekey=0-x9BJJE6932jIv9fFoecjeQ&usp=drive_link Bug: 262187603 Bug: 242252864 Fix: 262187603 Fix: 242252864 Test: manual Change-Id: Id1a8b5291d66a38fb86f168d3115ae566e6ec079
This commit is contained in:
@@ -104,4 +104,18 @@ public class PowerGaugePreferenceTest {
|
||||
assertThat(mPreferenceViewHolder.findViewById(android.R.id.title).getContentDescription())
|
||||
.isEqualTo(CONTENT_DESCRIPTION);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setPercent_greaterThanThreshold_showNumber() {
|
||||
mPowerGaugePreference.setPercent(99.5);
|
||||
|
||||
assertThat(mPowerGaugePreference.getPercent()).isEqualTo("100%");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setPercent_lessThanThreshold_showBar() {
|
||||
mPowerGaugePreference.setPercent(0.95);
|
||||
|
||||
assertThat(mPowerGaugePreference.getPercent()).isEqualTo("-");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user