Fix the bug using wrong TimeUnit

It should use DAYS, not HOURS.

Change-Id: I26784822c86e58cad93d35b6772ea54af7efb8f5
Fixes: 78362305
Test: RunSettingsRoboTests
This commit is contained in:
Lei Yu
2018-04-20 16:26:21 -07:00
parent 1257466d0b
commit 4c94926ba5
2 changed files with 54 additions and 5 deletions

View File

@@ -64,7 +64,7 @@ public class AnomalyCleanupJobService extends JobService {
final BatteryTipPolicy policy = new BatteryTipPolicy(this);
ThreadUtils.postOnBackgroundThread(() -> {
batteryDatabaseManager.deleteAllAnomaliesBeforeTimeStamp(
System.currentTimeMillis() - TimeUnit.HOURS.toMillis(
System.currentTimeMillis() - TimeUnit.DAYS.toMillis(
policy.dataHistoryRetainDay));
jobFinished(params, false /* wantsReschedule */);
});