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

Commit 070bcdd9 authored by Ale Nijamkin's avatar Ale Nijamkin Committed by Automerger Merge Worker
Browse files

Merge "Use event time instead of System.currentTimeMillis" into tm-qpr-dev am:...

Merge "Use event time instead of System.currentTimeMillis" into tm-qpr-dev am: 6de8305b am: 432bcab1

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



Change-Id: Ibf42243d1e024ef4a7a4958ee785dd28322e39c3
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 62c9ade8 432bcab1
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -342,14 +342,12 @@ object KeyguardBottomAreaViewBinder {

        private val longPressDurationMs = ViewConfiguration.getLongPressTimeout().toLong()
        private var longPressAnimator: ViewPropertyAnimator? = null
        private var downTimestamp = 0L

        @SuppressLint("ClickableViewAccessibility")
        override fun onTouch(v: View?, event: MotionEvent?): Boolean {
            return when (event?.actionMasked) {
                MotionEvent.ACTION_DOWN ->
                    if (viewModel.configKey != null) {
                        downTimestamp = System.currentTimeMillis()
                        longPressAnimator =
                            view
                                .animate()
@@ -396,7 +394,7 @@ object KeyguardBottomAreaViewBinder {
                MotionEvent.ACTION_UP -> {
                    cancel(
                        onAnimationEnd =
                            if (System.currentTimeMillis() - downTimestamp < longPressDurationMs) {
                            if (event.eventTime - event.downTime < longPressDurationMs) {
                                Runnable {
                                    messageDisplayer.invoke(
                                        R.string.keyguard_affordance_press_too_short
@@ -437,7 +435,6 @@ object KeyguardBottomAreaViewBinder {
        }

        private fun cancel(onAnimationEnd: Runnable? = null) {
            downTimestamp = 0L
            longPressAnimator?.cancel()
            longPressAnimator = null
            view.animate().scaleX(1f).scaleY(1f).withEndAction(onAnimationEnd)