[BatteryTips] Separate the low battery tips

Bug: 315748218
Test: atest SettingsRoboTestStub:com.android.settings.fuelgauge.batterytip.detectors.LowBatteryDetectorTest
Change-Id: Id973be37012da414d6125a4dd29ec4522ab80e95
This commit is contained in:
pajacechen
2024-01-31 16:11:55 +08:00
parent c7e0649c2e
commit 5dd8460c3e
6 changed files with 81 additions and 47 deletions

View File

@@ -18,6 +18,8 @@ package com.android.settings.fuelgauge;
import android.content.Context;
import com.android.settings.fuelgauge.batterytip.BatteryTipPolicy;
import com.android.settings.fuelgauge.batterytip.detectors.LowBatteryDetector;
import com.android.settings.fuelgauge.batterytip.tips.BatteryTip;
import java.util.List;
@@ -42,5 +44,10 @@ public class BatterySettingsFeatureProviderImpl implements BatterySettingsFeatur
@Override
public void addBatteryTipDetector(
Context context, List<BatteryTip> tips, BatteryInfo batteryInfo) {}
Context context,
List<BatteryTip> batteryTips,
BatteryInfo batteryInfo,
BatteryTipPolicy batteryTipPolicy) {
batteryTips.add(new LowBatteryDetector(context, batteryTipPolicy, batteryInfo).detect());
}
}