|
@@ -80,6 +80,7 @@ void main() { |
|
@@ -80,6 +80,7 @@ void main() { |
|
80
|
);
|
80
|
);
|
|
81
|
|
81
|
|
|
82
|
api.calls.clear();
|
82
|
api.calls.clear();
|
|
|
|
83
|
+ store.realtimeNotificationWindowQueryCount = 0;
|
|
83
|
final second = await service.startCoreCaculate(
|
84
|
final second = await service.startCoreCaculate(
|
|
84
|
endTime: base + 800,
|
85
|
endTime: base + 800,
|
|
85
|
readChunkDays: 1,
|
86
|
readChunkDays: 1,
|
|
@@ -90,6 +91,7 @@ void main() { |
|
@@ -90,6 +91,7 @@ void main() { |
|
90
|
second.realtimeStressPoints.map((e) => e.rawEndTime),
|
91
|
second.realtimeStressPoints.map((e) => e.rawEndTime),
|
|
91
|
[base + 720],
|
92
|
[base + 720],
|
|
92
|
);
|
93
|
);
|
|
|
|
94
|
+ expect(store.realtimeNotificationWindowQueryCount, 0);
|
|
93
|
expect(
|
95
|
expect(
|
|
94
|
api.firstCallStart(HealthDataUploadType.hrv.type),
|
96
|
api.firstCallStart(HealthDataUploadType.hrv.type),
|
|
95
|
lessThanOrEqualTo(base + 120),
|
97
|
lessThanOrEqualTo(base + 120),
|
|
@@ -869,6 +871,7 @@ class _MemoryHealthRawStressLocalStore extends HealthRawStressLocalStore { |
|
@@ -869,6 +871,7 @@ class _MemoryHealthRawStressLocalStore extends HealthRawStressLocalStore { |
|
869
|
final Map<int, List<HealthRawDailyStressPoint>> _daily = {};
|
871
|
final Map<int, List<HealthRawDailyStressPoint>> _daily = {};
|
|
870
|
final Map<int, List<HealthRawSleepResult>> _sleep = {};
|
872
|
final Map<int, List<HealthRawSleepResult>> _sleep = {};
|
|
871
|
final List<String> operationLog;
|
873
|
final List<String> operationLog;
|
|
|
|
874
|
+ var realtimeNotificationWindowQueryCount = 0;
|
|
872
|
|
875
|
|
|
873
|
void insertDailyStress(HealthRawDailyStressPoint point) {
|
876
|
void insertDailyStress(HealthRawDailyStressPoint point) {
|
|
874
|
final byDate = <int, HealthRawDailyStressPoint>{
|
877
|
final byDate = <int, HealthRawDailyStressPoint>{
|
|
@@ -1039,6 +1042,9 @@ class _MemoryHealthRawStressLocalStore extends HealthRawStressLocalStore { |
|
@@ -1039,6 +1042,9 @@ class _MemoryHealthRawStressLocalStore extends HealthRawStressLocalStore { |
|
1039
|
required int endTime,
|
1042
|
required int endTime,
|
|
1040
|
}) async {
|
1043
|
}) async {
|
|
1041
|
operationLog.add('queryRealtimeStressPoints');
|
1044
|
operationLog.add('queryRealtimeStressPoints');
|
|
|
|
1045
|
+ if (endTime - startTime <= Duration.secondsPerHour) {
|
|
|
|
1046
|
+ realtimeNotificationWindowQueryCount += 1;
|
|
|
|
1047
|
+ }
|
|
1042
|
return (_realtime[userId] ?? <HealthRawRealtimeStressPoint>[])
|
1048
|
return (_realtime[userId] ?? <HealthRawRealtimeStressPoint>[])
|
|
1043
|
.where((e) => e.rawEndTime >= startTime && e.rawEndTime <= endTime)
|
1049
|
.where((e) => e.rawEndTime >= startTime && e.rawEndTime <= endTime)
|
|
1044
|
.toList();
|
1050
|
.toList();
|