use of com.android.settingslib.fuelgauge.PowerAllowlistBackend in project android_packages_apps_Settings by omnirom.
the class AnomalyDetectionJobService method onStartJob.
@Override
public boolean onStartJob(JobParameters params) {
synchronized (mLock) {
mIsJobCanceled = false;
}
ThreadUtils.postOnBackgroundThread(() -> {
final Context context = AnomalyDetectionJobService.this;
final BatteryDatabaseManager batteryDatabaseManager = BatteryDatabaseManager.getInstance(this);
final BatteryTipPolicy policy = new BatteryTipPolicy(this);
final BatteryUtils batteryUtils = BatteryUtils.getInstance(this);
final ContentResolver contentResolver = getContentResolver();
final UserManager userManager = getSystemService(UserManager.class);
final PowerAllowlistBackend powerAllowlistBackend = PowerAllowlistBackend.getInstance(context);
final PowerUsageFeatureProvider powerUsageFeatureProvider = FeatureFactory.getFactory(this).getPowerUsageFeatureProvider(this);
final MetricsFeatureProvider metricsFeatureProvider = FeatureFactory.getFactory(this).getMetricsFeatureProvider();
for (JobWorkItem item = dequeueWork(params); item != null; item = dequeueWork(params)) {
saveAnomalyToDatabase(context, userManager, batteryDatabaseManager, batteryUtils, policy, powerAllowlistBackend, contentResolver, powerUsageFeatureProvider, metricsFeatureProvider, item.getIntent().getExtras());
completeWork(params, item);
}
});
return true;
}
Aggregations