Merge pull request #670 from jooray/fix/background-service-stops-on-pause

Keep the background service running when the app leaves the screen
This commit is contained in:
zjs81 authored and GitHub committed 2026-11-21 07:40:29 -07:00
commit eb0f7ae1ad
2 files changed
+37 -10

No files matched your search

@@ -0,0 +1,15 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:meshcore_open/services/background_service.dart';
void main() {
test('the foreground service does not stop when the app goes to the '
'background', () {
// flutter_foreground_task's stopWithTask option stops the service on the
// first activity pause, not on task removal. Swipe-away is handled by
// android:stopWithTask in the manifest instead.
final options = BackgroundService.taskOptions;
expect(options.stopWithTask, isNull);
expect(options.toJson().containsKey('stopWithTask'), isFalse);
expect(options.allowAutoRestart, isFalse);
});
}