Skip to content
Snippets Groups Projects
Commit 97d3fd46 authored by Oliver Scott's avatar Oliver Scott Committed by Dhina17
Browse files

fixup! SystemUI: Restore 14 QPR1 FingerprintInteractiveToAuth handling

Change-Id: I2804e1c49ba03e77180801c9fa6dacdd2eb233c9
parent f6b10044
No related branches found
No related tags found
No related merge requests found
......@@ -16,15 +16,41 @@
package com.android.systemui.biometrics
import android.content.Context
import android.hardware.biometrics.common.AuthenticateReason
import android.provider.Settings
import com.android.internal.R
import kotlinx.coroutines.flow.MutableStateFlow
import org.mockito.Mockito
class FakeFingerprintInteractiveToAuthProvider : FingerprintInteractiveToAuthProvider {
override val enabledForCurrentUser: MutableStateFlow<Boolean> = MutableStateFlow(false)
private val mockContext = Mockito.mock(Context::class.java)
private val defaultValue = if (mockContext.resources.getBoolean(
R.bool.config_fingerprintWakeAndUnlock)) {
1
} else {
0
}
private val userIdToExtension = mutableMapOf<Int, AuthenticateReason.Vendor>()
override fun getVendorExtension(userId: Int): AuthenticateReason.Vendor? =
userIdToExtension[userId]
userIdToExtension[userId]
override fun isEnabled(userId: Int): Boolean {
var value = Settings.Secure.getIntForUser(
mockContext.contentResolver, Settings.Secure.SFPS_PERFORMANT_AUTH_ENABLED,
-1,
userId,
)
if (value == -1) {
value = defaultValue
}
return value == 0
}
fun setVendorExtension(userId: Int, extension: AuthenticateReason.Vendor) {
userIdToExtension[userId] = extension
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment