Merge "Increase max metrics duration deviation to 2 hours" into main am: 84cc4e507e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2939460 Change-Id: I54d56d6a8c8bf92f680372fb026170c14f1bd68f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
fcb49c63a6
2 changed files with 5 additions and 4 deletions
|
|
@ -74,9 +74,10 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
public class KeepaliveStatsTracker {
|
||||
private static final String TAG = KeepaliveStatsTracker.class.getSimpleName();
|
||||
private static final int INVALID_KEEPALIVE_ID = -1;
|
||||
// 1 hour acceptable deviation in metrics collection duration time.
|
||||
// 2 hour acceptable deviation in metrics collection duration time to account for the 1 hour
|
||||
// window of AlarmManager.
|
||||
private static final long MAX_EXPECTED_DURATION_MS =
|
||||
AutomaticOnOffKeepaliveTracker.METRICS_COLLECTION_DURATION_MS + 1 * 60 * 60 * 1_000L;
|
||||
AutomaticOnOffKeepaliveTracker.METRICS_COLLECTION_DURATION_MS + 2 * 60 * 60 * 1_000L;
|
||||
|
||||
@NonNull private final Handler mConnectivityServiceHandler;
|
||||
@NonNull private final Dependencies mDependencies;
|
||||
|
|
|
|||
|
|
@ -1297,8 +1297,8 @@ public class KeepaliveStatsTrackerTest {
|
|||
|
||||
assertTrue(mKeepaliveStatsTracker.allMetricsExpected(dailyKeepaliveInfoReported));
|
||||
|
||||
// Write time after 26 hours.
|
||||
final int writeTime2 = 26 * 60 * 60 * 1000;
|
||||
// Write time after 27 hours.
|
||||
final int writeTime2 = 27 * 60 * 60 * 1000;
|
||||
setElapsedRealtime(writeTime2);
|
||||
|
||||
visibleOnHandlerThread(mTestHandler, () -> mKeepaliveStatsTracker.writeAndResetMetrics());
|
||||
|
|
|
|||
Loading…
Reference in a new issue