Merge "Add charging requirement for scheduled job." into tm-dev

This commit is contained in:
TreeHugger Robot
2022-04-14 22:28:35 +00:00
committed by Android (Google) Code Review

View File

@@ -441,6 +441,7 @@ public class BinaryTransparencyService extends SystemService {
final JobInfo jobInfo = new JobInfo.Builder(COMPUTE_APEX_MODULE_SHA256_JOB_ID, final JobInfo jobInfo = new JobInfo.Builder(COMPUTE_APEX_MODULE_SHA256_JOB_ID,
new ComponentName(context, UpdateMeasurementsJobService.class)) new ComponentName(context, UpdateMeasurementsJobService.class))
.setRequiresDeviceIdle(true) .setRequiresDeviceIdle(true)
.setRequiresCharging(true)
.build(); .build();
if (jobScheduler.schedule(jobInfo) != JobScheduler.RESULT_SUCCESS) { if (jobScheduler.schedule(jobInfo) != JobScheduler.RESULT_SUCCESS) {
Slog.e(TAG, "Failed to schedule job to update binary measurements."); Slog.e(TAG, "Failed to schedule job to update binary measurements.");