Skip to content

Commit

Permalink
Use ContextCompat
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Nov 15, 2019
1 parent 1dc5319 commit 3d285b9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package com.topjohnwu.magisk.utils

import androidx.biometric.BiometricManager
import androidx.biometric.BiometricPrompt
import androidx.core.content.ContextCompat
import androidx.fragment.app.FragmentActivity
import com.topjohnwu.magisk.Config
import com.topjohnwu.magisk.R
import com.topjohnwu.superuser.internal.UiThreadHandler
import org.koin.core.KoinComponent
import org.koin.core.get

Expand All @@ -32,7 +32,7 @@ object BiometricHelper: KoinComponent {
onError: () -> Unit = {},
onSuccess: () -> Unit): BiometricPrompt {
val prompt = BiometricPrompt(activity,
{ cmd: Runnable -> UiThreadHandler.run(cmd) },
ContextCompat.getMainExecutor(activity),
object : BiometricPrompt.AuthenticationCallback() {
override fun onAuthenticationError(errorCode: Int, errString: CharSequence) {
onError()
Expand Down

0 comments on commit 3d285b9

Please sign in to comment.