diff options
| author | 2023-02-27 16:23:23 -0500 | |
|---|---|---|
| committer | 2023-02-27 16:40:27 -0500 | |
| commit | c57906c4c6eae4ba4df8ed2906f7c679dc709c28 (patch) | |
| tree | 82400765bbd558f63e94f59a558a3f62a8d1ee54 | |
| parent | fc2551e544ed6699c0c39cc8d9575a30a3b9d3a0 (diff) | |
Custom Lockscreen shortcuts' long-press should call to FalsingManager
Bug: b/265030123
Test: manual; toggle shortcut on with and without precise tool
Change-Id: Ic6bec11923372c77ba1eaa13e9cf01a64f7e70fa
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBottomAreaViewBinder.kt | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBottomAreaViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBottomAreaViewBinder.kt index ab009f4a6a66..2a9060f6db47 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBottomAreaViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBottomAreaViewBinder.kt @@ -342,7 +342,13 @@ object KeyguardBottomAreaViewBinder { if (viewModel.isClickable) { if (viewModel.useLongPress) { view.setOnTouchListener( - OnTouchListener(view, viewModel, messageDisplayer, vibratorHelper) + OnTouchListener( + view, + viewModel, + messageDisplayer, + vibratorHelper, + falsingManager, + ) ) } else { view.setOnClickListener(OnClickListener(viewModel, checkNotNull(falsingManager))) @@ -371,6 +377,7 @@ object KeyguardBottomAreaViewBinder { private val viewModel: KeyguardQuickAffordanceViewModel, private val messageDisplayer: (Int) -> Unit, private val vibratorHelper: VibratorHelper?, + private val falsingManager: FalsingManager?, ) : View.OnTouchListener { private val longPressDurationMs = ViewConfiguration.getLongPressTimeout().toLong() @@ -395,7 +402,14 @@ object KeyguardBottomAreaViewBinder { .scaleY(PRESSED_SCALE) .setDuration(longPressDurationMs) .withEndAction { - dispatchClick(viewModel.configKey) + if ( + falsingManager + ?.isFalseLongTap( + FalsingManager.MODERATE_PENALTY + ) == false + ) { + dispatchClick(viewModel.configKey) + } cancel() } } @@ -421,7 +435,8 @@ object KeyguardBottomAreaViewBinder { // the pointer performs a click. if ( viewModel.configKey != null && - distanceMoved(event) <= ViewConfiguration.getTouchSlop() + distanceMoved(event) <= ViewConfiguration.getTouchSlop() && + falsingManager?.isFalseTap(FalsingManager.NO_PENALTY) == false ) { dispatchClick(viewModel.configKey) } |