|
@@ -8,6 +8,7 @@ import 'package:intl/date_symbol_data_local.dart'; |
|
@@ -8,6 +8,7 @@ import 'package:intl/date_symbol_data_local.dart'; |
|
8
|
|
8
|
|
|
9
|
import 'app/bootstrap/app_bootstrap.dart';
|
9
|
import 'app/bootstrap/app_bootstrap.dart';
|
|
10
|
import 'app/double_feel_app.dart';
|
10
|
import 'app/double_feel_app.dart';
|
|
|
|
11
|
+import 'core/config/app_environment_config.dart';
|
|
11
|
import 'core/services/raw_data_service/health_raw_data_core_service.dart';
|
12
|
import 'core/services/raw_data_service/health_raw_data_core_service.dart';
|
|
12
|
import 'core/services/raw_data_service/health_raw_models.dart';
|
13
|
import 'core/services/raw_data_service/health_raw_models.dart';
|
|
13
|
import 'core/theme/app_theme.dart';
|
14
|
import 'core/theme/app_theme.dart';
|
|
@@ -138,6 +139,9 @@ Future<void> _runPendingHealthTasks( |
|
@@ -138,6 +139,9 @@ Future<void> _runPendingHealthTasks( |
|
138
|
Future<void> _recordTemporaryHealthTaskReceived(
|
139
|
Future<void> _recordTemporaryHealthTaskReceived(
|
|
139
|
List<_BackgroundHealthTask> tasks,
|
140
|
List<_BackgroundHealthTask> tasks,
|
|
140
|
) async {
|
141
|
) async {
|
|
|
|
142
|
+ if (!_isHealthPipelineDebugEnabled) {
|
|
|
|
143
|
+ return;
|
|
|
|
144
|
+ }
|
|
141
|
try {
|
145
|
try {
|
|
142
|
await HealthKitRawDataHostApi().saveLocalNotificationDebugEvent(
|
146
|
await HealthKitRawDataHostApi().saveLocalNotificationDebugEvent(
|
|
143
|
event: <String, Object?>{
|
147
|
event: <String, Object?>{
|
|
@@ -162,6 +166,9 @@ bool _hasNewHealthCalculationResult(HealthRawStressCalculationResult result) { |
|
@@ -162,6 +166,9 @@ bool _hasNewHealthCalculationResult(HealthRawStressCalculationResult result) { |
|
162
|
}
|
166
|
}
|
|
163
|
|
167
|
|
|
164
|
Future<void> _healthBackgroundLog(MethodChannel channel, String message) async {
|
168
|
Future<void> _healthBackgroundLog(MethodChannel channel, String message) async {
|
|
|
|
169
|
+ if (!_isHealthPipelineDebugEnabled) {
|
|
|
|
170
|
+ return;
|
|
|
|
171
|
+ }
|
|
165
|
try {
|
172
|
try {
|
|
166
|
await channel.invokeMethod('healthBackgroundLog', {
|
173
|
await channel.invokeMethod('healthBackgroundLog', {
|
|
167
|
'message': message,
|
174
|
'message': message,
|
|
@@ -170,6 +177,13 @@ Future<void> _healthBackgroundLog(MethodChannel channel, String message) async { |
|
@@ -170,6 +177,13 @@ Future<void> _healthBackgroundLog(MethodChannel channel, String message) async { |
|
170
|
} catch (_) {}
|
177
|
} catch (_) {}
|
|
171
|
}
|
178
|
}
|
|
172
|
|
179
|
|
|
|
|
180
|
+bool get _isHealthPipelineDebugEnabled {
|
|
|
|
181
|
+ if (!Get.isRegistered<AppEnvironmentConfig>()) {
|
|
|
|
182
|
+ return false;
|
|
|
|
183
|
+ }
|
|
|
|
184
|
+ return Get.find<AppEnvironmentConfig>().isDebug;
|
|
|
|
185
|
+}
|
|
|
|
186
|
+
|
|
173
|
List<_BackgroundHealthTask> _backgroundHealthTasksFromArguments(
|
187
|
List<_BackgroundHealthTask> _backgroundHealthTasksFromArguments(
|
|
174
|
Object? arguments,
|
188
|
Object? arguments,
|
|
175
|
) {
|
189
|
) {
|