Skip to content

Commit 37d2a80

Browse files
p1gp1gmar-v-in
authored andcommitted
Fido: returns when no key is found
1 parent 372e184 commit 37d2a80

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

play-services-fido/core/src/main/kotlin/org/microg/gms/fido/core/transport/nfc/NfcTransportHandler.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ class NfcTransportHandler(private val activity: Activity, callback: TransportHan
112112
}
113113
try {
114114
(activity as OnNewIntentProvider).addOnNewIntentListener(newIntentListener)
115-
while (true) {
115+
var ex: Exception? = null
116+
for (i in 1..2) {
116117
val tag = waitForNewNfcTag(adapter)
117118
try {
118119
return handle(options, callerPackage, tag, pinRequested, pin)
@@ -124,8 +125,10 @@ class NfcTransportHandler(private val activity: Activity, callback: TransportHan
124125
throw e
125126
} catch (e: Exception) {
126127
Log.w(TAG, e)
128+
ex = e
127129
}
128130
}
131+
throw ex ?: Exception("Unknown exception")
129132
} finally {
130133
(activity as OnNewIntentProvider).removeOnNewIntentListener(newIntentListener)
131134
}

0 commit comments

Comments
 (0)