diff options
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java index d1494dfb107e..5e02e0440c3d 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardInputView.java @@ -16,6 +16,8 @@ package com.android.keyguard; +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; @@ -23,6 +25,7 @@ import android.widget.LinearLayout; import androidx.annotation.Nullable; +import com.android.internal.jank.InteractionJankMonitor; import com.android.systemui.Gefingerpoken; import java.util.ArrayList; @@ -83,4 +86,30 @@ public abstract class KeyguardInputView extends LinearLayout { listener -> listener.onInterceptTouchEvent(event)) || super.onInterceptTouchEvent(event); } + + protected AnimatorListenerAdapter getAnimationListener(int cuj) { + return new AnimatorListenerAdapter() { + private boolean mIsCancel; + + @Override + public void onAnimationCancel(Animator animation) { + mIsCancel = true; + } + + @Override + public void onAnimationEnd(Animator animation) { + if (mIsCancel) { + InteractionJankMonitor.getInstance().cancel(cuj); + } else { + InteractionJankMonitor.getInstance().end(cuj); + } + } + + @Override + public void onAnimationStart(Animator animation) { + InteractionJankMonitor.getInstance().begin(KeyguardInputView.this, cuj); + } + }; + } + } |