Loading packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/ui/viewmodel/CredentialViewModelTest.kt +2 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ import com.android.systemui.biometrics.domain.interactor.promptSelectorInteracto import com.android.systemui.biometrics.promptInfo import com.android.systemui.biometrics.shared.model.BiometricModalities import com.android.systemui.biometrics.shared.model.PromptKind import com.android.systemui.haptics.msdl.msdlPlayer import com.android.systemui.kosmos.testScope import com.android.systemui.shade.domain.interactor.shadeInteractor import com.android.systemui.testKosmos Loading Loading @@ -50,6 +51,7 @@ class CredentialViewModelTest : SysuiTestCase() { PromptCredentialInteractor(dispatcher, promptRepository, credentialInteractor), kosmos.shadeInteractor, kosmos.promptSelectorInteractor, kosmos.msdlPlayer, ) kosmos.testScope.runCurrent() Loading packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/CredentialPatternViewBinder.kt +5 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,11 @@ object CredentialPatternViewBinder { view.repeatWhenAttached { repeatOnLifecycle(Lifecycle.State.STARTED) { if (com.android.systemui.Flags.msdlFeedback()) { lockPatternView.setExternalHapticsPlayer { viewModel.performPatternDotFeedback() } } // observe credential validation attempts and submit/cancel buttons launch { viewModel.header.collect { header -> Loading packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/CredentialViewModel.kt +5 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ import com.android.systemui.biometrics.shared.model.WatchRangingState import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.res.R import com.android.systemui.shade.domain.interactor.ShadeInteractor import com.google.android.msdl.data.model.MSDLToken import com.google.android.msdl.domain.MSDLPlayer import javax.inject.Inject import kotlin.reflect.KClass import kotlinx.coroutines.flow.Flow Loading @@ -37,6 +39,7 @@ constructor( private val promptCredentialInteractor: PromptCredentialInteractor, shadeInteractor: ShadeInteractor, private val promptSelectorInteractor: PromptSelectorInteractor, private val msdlPlayer: MSDLPlayer, ) { /** * Whether credential is allowed in the prompt True if bp caller requested credential and Loading Loading @@ -243,6 +246,8 @@ constructor( ) context.startActivity(intent) } fun performPatternDotFeedback() = msdlPlayer.playToken(MSDLToken.DRAG_INDICATOR_DISCRETE) } private fun Context.asBadCredentialErrorMessage(prompt: BiometricPromptRequest?): String = Loading packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/ui/viewmodel/CredentialViewModelKosmos.kt +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.biometrics.ui.viewmodel import android.content.applicationContext import com.android.systemui.biometrics.domain.interactor.promptCredentialInteractor import com.android.systemui.biometrics.domain.interactor.promptSelectorInteractor import com.android.systemui.haptics.msdl.msdlPlayer import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.Kosmos.Fixture import com.android.systemui.shade.domain.interactor.shadeInteractor Loading @@ -29,5 +30,6 @@ val Kosmos.credentialViewModel by Fixture { promptCredentialInteractor, shadeInteractor, promptSelectorInteractor, msdlPlayer, ) } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/ui/viewmodel/CredentialViewModelTest.kt +2 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ import com.android.systemui.biometrics.domain.interactor.promptSelectorInteracto import com.android.systemui.biometrics.promptInfo import com.android.systemui.biometrics.shared.model.BiometricModalities import com.android.systemui.biometrics.shared.model.PromptKind import com.android.systemui.haptics.msdl.msdlPlayer import com.android.systemui.kosmos.testScope import com.android.systemui.shade.domain.interactor.shadeInteractor import com.android.systemui.testKosmos Loading Loading @@ -50,6 +51,7 @@ class CredentialViewModelTest : SysuiTestCase() { PromptCredentialInteractor(dispatcher, promptRepository, credentialInteractor), kosmos.shadeInteractor, kosmos.promptSelectorInteractor, kosmos.msdlPlayer, ) kosmos.testScope.runCurrent() Loading
packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/CredentialPatternViewBinder.kt +5 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,11 @@ object CredentialPatternViewBinder { view.repeatWhenAttached { repeatOnLifecycle(Lifecycle.State.STARTED) { if (com.android.systemui.Flags.msdlFeedback()) { lockPatternView.setExternalHapticsPlayer { viewModel.performPatternDotFeedback() } } // observe credential validation attempts and submit/cancel buttons launch { viewModel.header.collect { header -> Loading
packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/CredentialViewModel.kt +5 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ import com.android.systemui.biometrics.shared.model.WatchRangingState import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.res.R import com.android.systemui.shade.domain.interactor.ShadeInteractor import com.google.android.msdl.data.model.MSDLToken import com.google.android.msdl.domain.MSDLPlayer import javax.inject.Inject import kotlin.reflect.KClass import kotlinx.coroutines.flow.Flow Loading @@ -37,6 +39,7 @@ constructor( private val promptCredentialInteractor: PromptCredentialInteractor, shadeInteractor: ShadeInteractor, private val promptSelectorInteractor: PromptSelectorInteractor, private val msdlPlayer: MSDLPlayer, ) { /** * Whether credential is allowed in the prompt True if bp caller requested credential and Loading Loading @@ -243,6 +246,8 @@ constructor( ) context.startActivity(intent) } fun performPatternDotFeedback() = msdlPlayer.playToken(MSDLToken.DRAG_INDICATOR_DISCRETE) } private fun Context.asBadCredentialErrorMessage(prompt: BiometricPromptRequest?): String = Loading
packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/ui/viewmodel/CredentialViewModelKosmos.kt +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.biometrics.ui.viewmodel import android.content.applicationContext import com.android.systemui.biometrics.domain.interactor.promptCredentialInteractor import com.android.systemui.biometrics.domain.interactor.promptSelectorInteractor import com.android.systemui.haptics.msdl.msdlPlayer import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.Kosmos.Fixture import com.android.systemui.shade.domain.interactor.shadeInteractor Loading @@ -29,5 +30,6 @@ val Kosmos.credentialViewModel by Fixture { promptCredentialInteractor, shadeInteractor, promptSelectorInteractor, msdlPlayer, ) }