Don't show high usage tip when device is charing

The summary is "Battery may run out soon", it doesn't make sense
when device is charging.

Change-Id: I27394c8a75dac4dcad171e5e215102d39cb33546
Fixes: 78261389
Test: RunSettingsRoboTests
This commit is contained in:
Lei Yu
2018-04-20 13:08:50 -07:00
parent 1257466d0b
commit 69c370f594
3 changed files with 19 additions and 6 deletions

View File

@@ -68,7 +68,8 @@ public class BatteryTipLoader extends AsyncLoader<List<BatteryTip>> {
final Context context = getContext();
tips.add(new LowBatteryDetector(policy, batteryInfo).detect());
tips.add(new HighUsageDetector(context, policy, mBatteryStatsHelper).detect());
tips.add(new HighUsageDetector(context, policy, mBatteryStatsHelper,
batteryInfo.discharging).detect());
tips.add(new SmartBatteryDetector(policy, context.getContentResolver()).detect());
tips.add(new EarlyWarningDetector(policy, context).detect());
tips.add(new SummaryDetector(policy, batteryInfo.averageTimeToDischarge).detect());