From 90cd67ac650a4c8882d6cbdf7d4a01fc96f73df9 Mon Sep 17 00:00:00 2001 From: Adam Velebil Date: Tue, 10 Sep 2024 19:32:13 +0200 Subject: [PATCH] preserve connections in addToAny methods --- lib/android/oath/state.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/android/oath/state.dart b/lib/android/oath/state.dart index bf9032c3..36416670 100755 --- a/lib/android/oath/state.dart +++ b/lib/android/oath/state.dart @@ -36,6 +36,7 @@ import '../../exception/platform_exception_decoder.dart'; import '../../oath/models.dart'; import '../../oath/state.dart'; import '../../widgets/toast.dart'; +import '../app_methods.dart'; import '../overlay/nfc/method_channel_notifier.dart'; import '../overlay/nfc/nfc_overlay.dart'; @@ -194,6 +195,7 @@ final addCredentialToAnyProvider = Provider((ref) => (Uri credentialUri, {bool requireTouch = false}) async { final oath = ref.watch(_oathMethodsProvider.notifier); try { + await preserveConnectedDeviceWhenPaused(); var result = jsonDecode(await oath.invoke('addAccountToAny', { 'uri': credentialUri.toString(), 'requireTouch': requireTouch @@ -209,6 +211,7 @@ final addCredentialsToAnyProvider = Provider( (ref) => (List credentialUris, List touchRequired) async { final oath = ref.read(_oathMethodsProvider.notifier); try { + await preserveConnectedDeviceWhenPaused(); _log.debug( 'Calling android with ${credentialUris.length} credentials to be added'); var result = jsonDecode(await oath.invoke('addAccountsToAny',