From 8e2189dc712acdc1c3369db89bc7e2401a9085af Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Tue, 8 Jan 2019 12:43:07 +0100 Subject: [PATCH] Add better information for invalid path Test: Fling shade Bug: 120200303 Change-Id: Id2ca27e059c58471e6f0cd262a04d19c42afe348 --- .../systemui/statusbar/FlingAnimationUtils.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/FlingAnimationUtils.java b/packages/SystemUI/src/com/android/systemui/statusbar/FlingAnimationUtils.java index 758fb7a9971e2..22d1d5b233cef 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/FlingAnimationUtils.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/FlingAnimationUtils.java @@ -18,12 +18,14 @@ package com.android.systemui.statusbar; import android.animation.Animator; import android.content.Context; +import android.util.Log; import android.view.ViewPropertyAnimator; import android.view.animation.Interpolator; import android.view.animation.PathInterpolator; import com.android.systemui.Interpolators; import com.android.systemui.statusbar.notification.NotificationUtils; +import com.android.systemui.statusbar.phone.StatusBar; /** * Utility class to calculate general fling animation when the finger is released. @@ -196,9 +198,16 @@ public class FlingAnimationUtils { if (startGradient != mCachedStartGradient || velocityFactor != mCachedVelocityFactor) { float speedup = mSpeedUpFactor * (1.0f - velocityFactor); - mInterpolator = new PathInterpolator(speedup, - speedup * startGradient, - mLinearOutSlowInX2, mY2); + float x1 = speedup; + float y1 = speedup * startGradient; + float x2 = mLinearOutSlowInX2; + float y2 = mY2; + try { + mInterpolator = new PathInterpolator(x1, y1, x2, y2); + } catch (IllegalArgumentException e) { + throw new IllegalArgumentException("Illegal path with " + + "x1=" + x1 + " y1=" + y1 + " x2=" + x2 + " y2=" + y2, e); + } mCachedStartGradient = startGradient; mCachedVelocityFactor = velocityFactor; }