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

Commit f7bb13fb 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 am: 7c776b43

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



Change-Id: I37f23df093d97549176ba9018f9182b53943067b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 4d25c7d7 7c776b43
Loading
Loading
Loading
Loading
+18 −3
Original line number Original line Diff line number Diff line
@@ -342,7 +342,13 @@ object KeyguardBottomAreaViewBinder {
        if (viewModel.isClickable) {
        if (viewModel.isClickable) {
            if (viewModel.useLongPress) {
            if (viewModel.useLongPress) {
                view.setOnTouchListener(
                view.setOnTouchListener(
                    OnTouchListener(view, viewModel, messageDisplayer, vibratorHelper)
                    OnTouchListener(
                        view,
                        viewModel,
                        messageDisplayer,
                        vibratorHelper,
                        falsingManager,
                    )
                )
                )
            } else {
            } else {
                view.setOnClickListener(OnClickListener(viewModel, checkNotNull(falsingManager)))
                view.setOnClickListener(OnClickListener(viewModel, checkNotNull(falsingManager)))
@@ -371,6 +377,7 @@ object KeyguardBottomAreaViewBinder {
        private val viewModel: KeyguardQuickAffordanceViewModel,
        private val viewModel: KeyguardQuickAffordanceViewModel,
        private val messageDisplayer: (Int) -> Unit,
        private val messageDisplayer: (Int) -> Unit,
        private val vibratorHelper: VibratorHelper?,
        private val vibratorHelper: VibratorHelper?,
        private val falsingManager: FalsingManager?,
    ) : View.OnTouchListener {
    ) : View.OnTouchListener {


        private val longPressDurationMs = ViewConfiguration.getLongPressTimeout().toLong()
        private val longPressDurationMs = ViewConfiguration.getLongPressTimeout().toLong()
@@ -395,7 +402,14 @@ object KeyguardBottomAreaViewBinder {
                                    .scaleY(PRESSED_SCALE)
                                    .scaleY(PRESSED_SCALE)
                                    .setDuration(longPressDurationMs)
                                    .setDuration(longPressDurationMs)
                                    .withEndAction {
                                    .withEndAction {
                                        if (
                                            falsingManager
                                                ?.isFalseLongTap(
                                                    FalsingManager.MODERATE_PENALTY
                                                ) == false
                                        ) {
                                            dispatchClick(viewModel.configKey)
                                            dispatchClick(viewModel.configKey)
                                        }
                                        cancel()
                                        cancel()
                                    }
                                    }
                        }
                        }
@@ -421,7 +435,8 @@ object KeyguardBottomAreaViewBinder {
                        // the pointer performs a click.
                        // the pointer performs a click.
                        if (
                        if (
                            viewModel.configKey != null &&
                            viewModel.configKey != null &&
                                distanceMoved(event) <= ViewConfiguration.getTouchSlop()
                                distanceMoved(event) <= ViewConfiguration.getTouchSlop() &&
                                falsingManager?.isFalseTap(FalsingManager.NO_PENALTY) == false
                        ) {
                        ) {
                            dispatchClick(viewModel.configKey)
                            dispatchClick(viewModel.configKey)
                        }
                        }