Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 218fb8f2 authored by Alejandro Nijamkin's avatar Alejandro Nijamkin
Browse files

[flexiglass] Call avoidGesture in falsing from PIN bouncer

Fix: 365877972
Test: unit tests included
Test: manually verified that the FalsingCollector is receiving the
avoidGesture on each PIN button click
Flag: com.android.systemui.scene_container

Change-Id: Ia10503da79965c5664162cff584c05525187fb72
parent 3cd3d80e
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -29,11 +29,11 @@ import android.view.KeyEvent.isConfirmKey
import android.view.View
import androidx.compose.ui.input.key.KeyEvent
import androidx.compose.ui.input.key.KeyEventType
import com.android.app.tracing.coroutines.launchTraced as launch
import com.android.keyguard.PinShapeAdapter
import com.android.systemui.authentication.shared.model.AuthenticationMethodModel
import com.android.systemui.bouncer.domain.interactor.BouncerInteractor
import com.android.systemui.bouncer.domain.interactor.SimBouncerInteractor
import com.android.systemui.bouncer.shared.flag.ComposeBouncerFlags
import com.android.systemui.bouncer.ui.helper.BouncerHapticPlayer
import com.android.systemui.res.R
import dagger.assisted.Assisted
@@ -50,7 +50,6 @@ import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.receiveAsFlow
import com.android.app.tracing.coroutines.launchTraced as launch

/** Holds UI state and handles user input for the PIN code bouncer UI. */
class PinBouncerViewModel
@@ -289,11 +288,10 @@ constructor(
     * feedback on the view.
     */
    fun onDigitButtonDown(view: View?) {
        if (ComposeBouncerFlags.isOnlyComposeBouncerEnabled()) {
            // Current PIN bouncer informs FalsingInteractor#avoidGesture() upon every Pin button
            // touch.
        // This ends up calling FalsingInteractor#avoidGesture() each time a PIN button is touched.
        // It helps make sure that legitimate touch in the PIN bouncer isn't treated as false touch.
        super.onDown()
        }

        if (bouncerHapticPlayer?.isEnabled == true) {
            bouncerHapticPlayer.playNumpadKeyFeedback()
        } else {