BiometricPromptCompat icon indicating copy to clipboard operation
BiometricPromptCompat copied to clipboard

Compat dialog shows previously cancelled error

Open nealsanche opened this issue 7 years ago • 1 comments

To replicate:

  1. Show dialog, but hit cancel.
  2. Show dialog again (on a device that needs compat, like API27 emulator), will see the cancelled error from the previous invocation.

Here's a video that demonstrates what we see:

2018-09-10_11-26-17

Creation code looks like:

val prompt = BiometricPromptCompat.Builder(context)
                .setTitle(context.getString(R.string.biometrics_enroll_title))
                .setDescription(context.getString(R.string.biometrics_enroll_subtitle))
                .setNegativeButton(context.getString(R.string.biometrics_cancel)) { dialogInterface, _ ->
                    dialogInterface?.let {
                        dialogInterface.cancel()
                        dialogInterface.dismiss()
                    }
                    emitter.onError(DomainException(DomainError.BIOMETRICS_CANCELLED_BY_USER))
                }
                .build()

Maybe it's my negative button handling there, which calls cancel and then dismiss?

nealsanche avatar Sep 10 '18 19:09 nealsanche

Maybe I need to write some code to clear the status (of FingerprintManager) each BiometricPrompt's beginning.

fython avatar Sep 14 '18 03:09 fython