use of com.android.settings.fuelgauge.batterytip.detectors.LowBatteryDetector in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BatteryTipLoader method loadInBackground.
@Override
public List<BatteryTip> loadInBackground() {
if (USE_FAKE_DATA) {
return getFakeData();
}
final List<BatteryTip> tips = new ArrayList<>();
final BatteryTipPolicy policy = new BatteryTipPolicy(getContext());
final BatteryInfo batteryInfo = mBatteryUtils.getBatteryInfo(mBatteryStatsHelper, TAG);
final Context context = getContext();
tips.add(new LowBatteryDetector(context, policy, batteryInfo).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());
tips.add(new RestrictAppDetector(context, policy).detect());
Collections.sort(tips);
return tips;
}
use of com.android.settings.fuelgauge.batterytip.detectors.LowBatteryDetector in project android_packages_apps_Settings by omnirom.
the class BatteryTipLoader method loadInBackground.
@Override
public List<BatteryTip> loadInBackground() {
if (USE_FAKE_DATA) {
return getFakeData();
}
final List<BatteryTip> tips = new ArrayList<>();
final BatteryTipPolicy policy = new BatteryTipPolicy(getContext());
final BatteryInfo batteryInfo = mBatteryUtils.getBatteryInfo(TAG);
final Context context = getContext();
tips.add(new LowBatteryDetector(context, policy, batteryInfo).detect());
tips.add(new HighUsageDetector(context, policy, mBatteryUsageStats, batteryInfo).detect());
tips.add(new SmartBatteryDetector(context, policy, batteryInfo, context.getContentResolver()).detect());
tips.add(new EarlyWarningDetector(policy, context).detect());
tips.add(new BatteryDefenderDetector(batteryInfo).detect());
// Disable this feature now since it introduces false positive cases. We will try to improve
// it in the future.
// tips.add(new RestrictAppDetector(context, policy).detect());
Collections.sort(tips);
return tips;
}
Aggregations