Fix LingerMonitor notification rate limiting

If time since boot is lower than the rate limit, notifications would not
be shown.
This is causing tests to fail on continuous testing.

Test: atest FrameworksNetTests
Bug: b/117516272
Change-Id: I03da28f2ca61119fa0ef9534bb4ce3f6406c1ff2
This commit is contained in:
Remi NGUYEN VAN
2018-11-02 16:33:23 +09:00
parent 431d07e60a
commit 032dfe5ce5

View File

@@ -90,6 +90,8 @@ public class LingerMonitor {
mNotifier = notifier;
mDailyLimit = dailyLimit;
mRateLimitMillis = rateLimitMillis;
// Ensure that (now - mFirstNotificationMillis) >= rateLimitMillis at first
mFirstNotificationMillis = -rateLimitMillis;
}
private static HashMap<String, Integer> makeTransportToNameMap() {