mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-25 10:47:38 +00:00
Use ContextCompat
This commit is contained in:
parent
1dc531930d
commit
3d285b91c6
@ -2,10 +2,10 @@ package com.topjohnwu.magisk.utils
|
|||||||
|
|
||||||
import androidx.biometric.BiometricManager
|
import androidx.biometric.BiometricManager
|
||||||
import androidx.biometric.BiometricPrompt
|
import androidx.biometric.BiometricPrompt
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
import com.topjohnwu.magisk.Config
|
import com.topjohnwu.magisk.Config
|
||||||
import com.topjohnwu.magisk.R
|
import com.topjohnwu.magisk.R
|
||||||
import com.topjohnwu.superuser.internal.UiThreadHandler
|
|
||||||
import org.koin.core.KoinComponent
|
import org.koin.core.KoinComponent
|
||||||
import org.koin.core.get
|
import org.koin.core.get
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ object BiometricHelper: KoinComponent {
|
|||||||
onError: () -> Unit = {},
|
onError: () -> Unit = {},
|
||||||
onSuccess: () -> Unit): BiometricPrompt {
|
onSuccess: () -> Unit): BiometricPrompt {
|
||||||
val prompt = BiometricPrompt(activity,
|
val prompt = BiometricPrompt(activity,
|
||||||
{ cmd: Runnable -> UiThreadHandler.run(cmd) },
|
ContextCompat.getMainExecutor(activity),
|
||||||
object : BiometricPrompt.AuthenticationCallback() {
|
object : BiometricPrompt.AuthenticationCallback() {
|
||||||
override fun onAuthenticationError(errorCode: Int, errString: CharSequence) {
|
override fun onAuthenticationError(errorCode: Int, errString: CharSequence) {
|
||||||
onError()
|
onError()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user