Skip to content

Commit

Permalink
Fix transfer manager initialization causing app lock up on NFC tap.
Browse files Browse the repository at this point in the history
+ fixed in AppVerifier.
+ fixed in SimpleVerifier.
+ fixed in Wallet Reader.

Tested manually. Tap with the phone running Wallet.

Signed-off-by: koukarine <[email protected]>
  • Loading branch information
koukarine committed Jan 29, 2025
1 parent 436f374 commit 4105ca6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ class RequestOptionsFragment() : Fragment() {
// Always call to cancel any connection that could be on progress
transferManager.disconnect()
}
transferManager.initVerificationHelper()
observeTransferManager()
}

Expand Down Expand Up @@ -301,6 +300,7 @@ class RequestOptionsFragment() : Fragment() {
checkRequiredPermissions()
val adapter = NfcAdapter.getDefaultAdapter(requireContext())
if (adapter != null) {
transferManager.initVerificationHelper()
transferManager.setNdefDeviceEngagement(
adapter,
requireActivity()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@ class MdocReaderPrompt(
verification.disconnect()
super.onDismiss(dialog)
}

override fun onResume() {
super.onResume()
initializeWithContext()
}
}

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fun ReaderScreen(
val lifecycleOwner = LocalLifecycleOwner.current
DisposableEffect(lifecycleOwner) {
val observer = LifecycleEventObserver { _, event ->
if (event == Lifecycle.Event.ON_START) {
if (event == Lifecycle.Event.ON_START || event == Lifecycle.Event.ON_RESUME) {
model.startRequest(
activity,
availableRequests[0].second,
Expand Down

0 comments on commit 4105ca6

Please sign in to comment.