From 6af4d0965d09c8b918109b4e939681b0f90d3544 Mon Sep 17 00:00:00 2001 From: Matthew Ng Date: Tue, 6 Mar 2018 14:43:20 -0800 Subject: [PATCH] Fixes KeyButtonView to dismiss ripple after aborting for long press When set pressed state to true after aborting gesture to show ripple, the set pressed state was not set back to false even though it receives a cancel motion event. This leads to showing the ripple without dismissing it. To dismiss the ripple, when receiving the cancel motion event, set pressed state to false. Change-Id: Ic3b9c8e1ecd6cff8ba7a34c2c179a9810f962862 Fixes: 74136297 Test: With an app open in fullscreen, long press home --- .../com/android/systemui/statusbar/policy/KeyButtonView.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java index aec05cd9218fc..7620f5f681c57 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java @@ -216,6 +216,9 @@ public class KeyButtonView extends ImageView implements ButtonInterface { mGestureAborted = false; } if (mGestureAborted) { + if (mIsPressed) { + setPressed(false); + } return false; }