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

Commit 7c776b43 authored by Brad Hinegardner's avatar Brad Hinegardner Committed by Automerger Merge Worker
Browse files

Merge "Custom Lockscreen shortcuts' long-press should call to FalsingManager"...

Merge "Custom Lockscreen shortcuts' long-press should call to FalsingManager" into tm-qpr-dev am: e58ae094

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21615642



Change-Id: If33a8c2c53e0663ae32a38eb4c5962571d656a12
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f085594e e58ae094
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -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 {
                                        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)
                        }