Reduce the calling times for isExtraDefend

Only calling this HAL API when BatteryDefenderTips card need to be shown

Bug: 243465597
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.fuelgauge.*
Change-Id: Iae3c03d946ec29fe78a826ce62b6bebd893704ef
This commit is contained in:
Pajace Chen
2022-08-23 13:53:56 +08:00
parent bf23a06eac
commit b00140b7a3
3 changed files with 18 additions and 14 deletions

View File

@@ -18,6 +18,8 @@ package com.android.settings.fuelgauge.batterytip.detectors;
import static com.google.common.truth.Truth.assertThat;
import androidx.test.core.app.ApplicationProvider;
import com.android.settings.fuelgauge.BatteryInfo;
import com.android.settings.fuelgauge.batterytip.tips.BatteryTip;
@@ -42,7 +44,7 @@ public class BatteryDefenderDetectorTest {
mBatteryInfo.discharging = false;
mBatteryDefenderDetector = new BatteryDefenderDetector(
mBatteryInfo, /* extraDefend= */ false);
mBatteryInfo, ApplicationProvider.getApplicationContext());
}
@Test