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

Commit f1d3ede4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Ensure that velocity tracker is never null." into rvc-dev am: 05df6a58 am: f91005b4

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

Change-Id: Ic46131d8d69eee669c6e499baf257eb7cae392f0
parents 25e7ac7c f91005b4
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import android.os.SystemClock
import android.view.MotionEvent
import android.view.VelocityTracker
import android.view.ViewConfiguration

import com.android.systemui.Gefingerpoken
import com.android.systemui.Interpolators
import com.android.systemui.R
@@ -41,7 +40,6 @@ import com.android.systemui.statusbar.notification.stack.NotificationStackScroll
import com.android.systemui.statusbar.phone.HeadsUpManagerPhone
import com.android.systemui.statusbar.phone.KeyguardBypassController
import com.android.systemui.statusbar.phone.ShadeController

import javax.inject.Inject
import javax.inject.Singleton
import kotlin.math.max
@@ -162,10 +160,12 @@ constructor(

            MotionEvent.ACTION_UP -> {
                recycleVelocityTracker()
                isExpanding = false
            }

            MotionEvent.ACTION_CANCEL -> {
                recycleVelocityTracker()
                isExpanding = false
            }
        }
        return false
@@ -181,7 +181,8 @@ constructor(
            return false
        }

        if (!isExpanding || event.actionMasked == MotionEvent.ACTION_DOWN) {
        if (velocityTracker == null || !isExpanding ||
                event.actionMasked == MotionEvent.ACTION_DOWN) {
            return startExpansion(event)
        }
        velocityTracker!!.addMovement(event)