Update the setOverrideDeadline in the legacy AnomalyDetectionJobService

Update the setOverrideDeadline based on the suggestion in the b/319721625, and remove the legacy anomaly detection mechanism from the main entry BroadcastReceiver

Fix: 319721625
Test: make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.fuelgauge.batterytip"
Change-Id: I1276bfc95d9cf36a60e28612ebb8a295fd58083b
This commit is contained in:
ykhung
2024-01-15 17:10:58 +08:00
committed by YK Hung
parent 4130a95c5d
commit 22273161fd
3 changed files with 4 additions and 10 deletions

View File

@@ -71,6 +71,7 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.android.controller.ServiceController;
import org.robolectric.annotation.Config;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -133,7 +134,7 @@ public class AnomalyDetectionJobServiceTest {
JobInfo pendingJob = pendingJobs.get(0);
assertThat(pendingJob.getId()).isEqualTo(R.integer.job_anomaly_detection);
assertThat(pendingJob.getMaxExecutionDelayMillis())
.isEqualTo(TimeUnit.MINUTES.toMillis(30));
.isEqualTo(Duration.ofDays(1).toMillis());
}
@Test