summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alejandro Nijamkin <nijamkin@google.com> 2025-01-14 09:36:20 -0800
committer Alejandro Nijamkin <nijamkin@google.com> 2025-01-14 09:36:20 -0800
commit218fb8f219f2a9d1f5bd3dc2cb47751dc00bb3ce (patch)
treeb2575ac47dccef9a66a488f2e924664f66946f1c
parent3cd3d80e84809fbfffa1021db0a045a0627a5500 (diff)
[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
-rw-r--r--packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/PinBouncerViewModel.kt12
1 files changed, 5 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/PinBouncerViewModel.kt b/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/PinBouncerViewModel.kt
index 5baec1e025e8..73aaf7f8e460 100644
--- a/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/PinBouncerViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/PinBouncerViewModel.kt
@@ -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.
- super.onDown()
- }
+ // 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 {