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:
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);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user