Loading res/values/ids.xml +0 −3 Original line number Diff line number Diff line Loading @@ -18,9 +18,6 @@ --> <resources> <item type="id" name="preference_highlighted" /> <item type="id" name="job_anomaly_clean_up" /> <item type="id" name="job_anomaly_config_update"/> <item type="id" name="job_anomaly_detection" /> <item type="id" name="lock_none" /> <item type="id" name="lock_pin" /> Loading res/values/integers.xml 0 → 100644 +22 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2018 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <resources> <!-- Reserve all the job ids in settings --> <integer name="job_anomaly_clean_up">100</integer> <integer name="job_anomaly_config_update">101</integer> <integer name="job_anomaly_detection">102</integer> </resources> No newline at end of file src/com/android/settings/fuelgauge/batterytip/AnomalyCleanupJobService.java +8 −3 Original line number Diff line number Diff line Loading @@ -42,12 +42,17 @@ public class AnomalyCleanupJobService extends JobService { final ComponentName component = new ComponentName(context, AnomalyCleanupJobService.class); final JobInfo.Builder jobBuilder = new JobInfo.Builder(R.id.job_anomaly_clean_up, component) new JobInfo.Builder(R.integer.job_anomaly_clean_up, component) .setPeriodic(CLEAN_UP_FREQUENCY_MS) .setRequiresDeviceIdle(true) .setRequiresCharging(true); .setRequiresCharging(true) .setPersisted(true); final JobInfo pending = jobScheduler.getPendingJob(R.integer.job_anomaly_clean_up); if (jobScheduler.schedule(jobBuilder.build()) != JobScheduler.RESULT_SUCCESS) { // Don't schedule it if it already exists, to make sure it runs periodically even after // reboot if (pending == null && jobScheduler.schedule(jobBuilder.build()) != JobScheduler.RESULT_SUCCESS) { Log.i(TAG, "Anomaly clean up job service schedule failed."); } } Loading src/com/android/settings/fuelgauge/batterytip/AnomalyConfigJobService.java +8 −3 Original line number Diff line number Diff line Loading @@ -52,12 +52,17 @@ public class AnomalyConfigJobService extends JobService { final ComponentName component = new ComponentName(context, AnomalyConfigJobService.class); final JobInfo.Builder jobBuilder = new JobInfo.Builder(R.id.job_anomaly_config_update, component) new JobInfo.Builder(R.integer.job_anomaly_config_update, component) .setPeriodic(CONFIG_UPDATE_FREQUENCY_MS) .setRequiresDeviceIdle(true) .setRequiresCharging(true); .setRequiresCharging(true) .setPersisted(true); final JobInfo pending = jobScheduler.getPendingJob(R.integer.job_anomaly_config_update); if (jobScheduler.schedule(jobBuilder.build()) != JobScheduler.RESULT_SUCCESS) { // Don't schedule it if it already exists, to make sure it runs periodically even after // reboot if (pending == null && jobScheduler.schedule(jobBuilder.build()) != JobScheduler.RESULT_SUCCESS) { Log.i(TAG, "Anomaly config update job service schedule failed."); } } Loading src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionJobService.java +1 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ public class AnomalyDetectionJobService extends JobService { final ComponentName component = new ComponentName(context, AnomalyDetectionJobService.class); final JobInfo.Builder jobBuilder = new JobInfo.Builder(R.id.job_anomaly_detection, component) new JobInfo.Builder(R.integer.job_anomaly_detection, component) .setOverrideDeadline(MAX_DELAY_MS); if (jobScheduler.enqueue(jobBuilder.build(), new JobWorkItem(intent)) Loading Loading
res/values/ids.xml +0 −3 Original line number Diff line number Diff line Loading @@ -18,9 +18,6 @@ --> <resources> <item type="id" name="preference_highlighted" /> <item type="id" name="job_anomaly_clean_up" /> <item type="id" name="job_anomaly_config_update"/> <item type="id" name="job_anomaly_detection" /> <item type="id" name="lock_none" /> <item type="id" name="lock_pin" /> Loading
res/values/integers.xml 0 → 100644 +22 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2018 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <resources> <!-- Reserve all the job ids in settings --> <integer name="job_anomaly_clean_up">100</integer> <integer name="job_anomaly_config_update">101</integer> <integer name="job_anomaly_detection">102</integer> </resources> No newline at end of file
src/com/android/settings/fuelgauge/batterytip/AnomalyCleanupJobService.java +8 −3 Original line number Diff line number Diff line Loading @@ -42,12 +42,17 @@ public class AnomalyCleanupJobService extends JobService { final ComponentName component = new ComponentName(context, AnomalyCleanupJobService.class); final JobInfo.Builder jobBuilder = new JobInfo.Builder(R.id.job_anomaly_clean_up, component) new JobInfo.Builder(R.integer.job_anomaly_clean_up, component) .setPeriodic(CLEAN_UP_FREQUENCY_MS) .setRequiresDeviceIdle(true) .setRequiresCharging(true); .setRequiresCharging(true) .setPersisted(true); final JobInfo pending = jobScheduler.getPendingJob(R.integer.job_anomaly_clean_up); if (jobScheduler.schedule(jobBuilder.build()) != JobScheduler.RESULT_SUCCESS) { // Don't schedule it if it already exists, to make sure it runs periodically even after // reboot if (pending == null && jobScheduler.schedule(jobBuilder.build()) != JobScheduler.RESULT_SUCCESS) { Log.i(TAG, "Anomaly clean up job service schedule failed."); } } Loading
src/com/android/settings/fuelgauge/batterytip/AnomalyConfigJobService.java +8 −3 Original line number Diff line number Diff line Loading @@ -52,12 +52,17 @@ public class AnomalyConfigJobService extends JobService { final ComponentName component = new ComponentName(context, AnomalyConfigJobService.class); final JobInfo.Builder jobBuilder = new JobInfo.Builder(R.id.job_anomaly_config_update, component) new JobInfo.Builder(R.integer.job_anomaly_config_update, component) .setPeriodic(CONFIG_UPDATE_FREQUENCY_MS) .setRequiresDeviceIdle(true) .setRequiresCharging(true); .setRequiresCharging(true) .setPersisted(true); final JobInfo pending = jobScheduler.getPendingJob(R.integer.job_anomaly_config_update); if (jobScheduler.schedule(jobBuilder.build()) != JobScheduler.RESULT_SUCCESS) { // Don't schedule it if it already exists, to make sure it runs periodically even after // reboot if (pending == null && jobScheduler.schedule(jobBuilder.build()) != JobScheduler.RESULT_SUCCESS) { Log.i(TAG, "Anomaly config update job service schedule failed."); } } Loading
src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionJobService.java +1 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ public class AnomalyDetectionJobService extends JobService { final ComponentName component = new ComponentName(context, AnomalyDetectionJobService.class); final JobInfo.Builder jobBuilder = new JobInfo.Builder(R.id.job_anomaly_detection, component) new JobInfo.Builder(R.integer.job_anomaly_detection, component) .setOverrideDeadline(MAX_DELAY_MS); if (jobScheduler.enqueue(jobBuilder.build(), new JobWorkItem(intent)) Loading