Clean up BatteryAppListPreferenceController

Bug: 256123455
Bug: 258576047
Fix: 258576047
Test: presubmit
Change-Id: I8c3d05f76e7a6995fccc34b2cc60ee126bb3d350
This commit is contained in:
Zaiyue Xue
2022-11-10 16:58:10 +08:00
parent df25b72044
commit 7a30768503
11 changed files with 179 additions and 905 deletions

View File

@@ -216,41 +216,6 @@ public class BatteryUtilsTest {
assertThat(time).isEqualTo(0);
}
@Test
public void testShouldHideSystemConsumer_TypeIdle_ReturnTrue() {
assertThat(mBatteryUtils.shouldHideDevicePowerComponent(mAggregateBatteryConsumer,
BatteryConsumer.POWER_COMPONENT_IDLE)).isTrue();
}
@Test
public void testShouldHideSystemConsumer_TypeMobileRadio_ReturnTrue() {
assertThat(mBatteryUtils.shouldHideDevicePowerComponent(mAggregateBatteryConsumer,
BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO)).isTrue();
}
@Test
public void testShouldHideSystemConsumer_TypeScreen_ReturnTrue() {
assertThat(mBatteryUtils.shouldHideDevicePowerComponent(mAggregateBatteryConsumer,
BatteryConsumer.POWER_COMPONENT_SCREEN)).isTrue();
}
@Test
public void testShouldHideSystemConsumer_TypeBluetooth_ReturnTrue() {
assertThat(mBatteryUtils.shouldHideDevicePowerComponent(mAggregateBatteryConsumer,
BatteryConsumer.POWER_COMPONENT_BLUETOOTH)).isTrue(); }
@Test
public void testShouldHideSystemConsumer_TypeWifi_ReturnTrue() {
assertThat(mBatteryUtils.shouldHideDevicePowerComponent(mAggregateBatteryConsumer,
BatteryConsumer.POWER_COMPONENT_WIFI)).isTrue();
}
@Test
public void testShouldHideSystemConsumer_OtherType_ReturnFalse() {
assertThat(mBatteryUtils.shouldHideDevicePowerComponent(mAggregateBatteryConsumer,
BatteryConsumer.POWER_COMPONENT_FLASHLIGHT)).isFalse();
}
@Test
public void testCalculateBatteryPercent() {
assertThat(mBatteryUtils.calculateBatteryPercent(BATTERY_SYSTEM_USAGE, TOTAL_BATTERY_USAGE,