mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-22 12:08:34 +00:00
Fix link device crash.
This commit is contained in:
committed by
Greyson Parrelli
parent
4dba584913
commit
9d0aef8dbc
@@ -1,6 +1,7 @@
|
||||
package org.thoughtcrime.securesms
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
@@ -51,7 +52,12 @@ class BiometricDeviceAuthentication(
|
||||
return if (!DISALLOWED_BIOMETRIC_VERSIONS.contains(Build.VERSION.SDK_INT) && biometricManager.canAuthenticate(ALLOWED_AUTHENTICATORS) == BiometricManager.BIOMETRIC_SUCCESS) {
|
||||
if (force) {
|
||||
Log.i(TAG, "Listening for biometric authentication...")
|
||||
biometricPrompt.authenticate(biometricPromptInfo)
|
||||
try {
|
||||
biometricPrompt.authenticate(biometricPromptInfo)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Log.w(TAG, "Failed to launch confirm device credential settings", e)
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
Log.i(TAG, "Skipping show system biometric or device lock dialog unless forced")
|
||||
}
|
||||
|
||||
@@ -135,7 +135,9 @@ class LinkDeviceFragment : ComposeFragment() {
|
||||
|
||||
LaunchedEffect(state.seenEducationSheet) {
|
||||
if (state.seenEducationSheet) {
|
||||
biometricAuth.authenticate(requireContext(), true) { biometricDeviceLockLauncher.launch(getString(R.string.LinkDeviceFragment__unlock_to_link)) }
|
||||
if (!biometricAuth.authenticate(requireContext(), true) { biometricDeviceLockLauncher.launch(getString(R.string.LinkDeviceFragment__unlock_to_link)) }) {
|
||||
navController.safeNavigate(R.id.action_linkDeviceFragment_to_addLinkDeviceFragment)
|
||||
}
|
||||
viewModel.markEducationSheetSeen(false)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user