From dbbf45e79affa3e29b0f376719d297fe9c1f8a37 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Wed, 25 Jun 2014 21:54:48 +0200 Subject: [PATCH] Attempt to fix infinite recursion. When collapsing a panel without animating, it might be that an overscroll animating was still running, and thus expandedHeight != 0 even if we set expandedFraction manually to 0, which sets the state to STATE_OPEN again and tries to close it in an infinite loop. Bug: 15721600 Change-Id: I14e0ee43fb4a47286d618cc97581d4e4a98fb2a2 --- .../android/systemui/statusbar/phone/NotificationPanelView.java | 2 ++ .../src/com/android/systemui/statusbar/phone/PanelBar.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index a6ce5d5a5fa31..c684c9f2e50cf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -302,6 +302,8 @@ public class NotificationPanelView extends PanelView implements mUnlockIconActive = false; mPageSwiper.reset(); closeQs(); + mNotificationStackScroller.setOverScrollAmount(0f, true /* onTop */, false /* animate */, + true /* cancelAnimators */); } public void closeQs() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java index b94f6f3d2fba5..b4faaaf545c8f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java @@ -188,10 +188,10 @@ public class PanelBar extends FrameLayout { pv.collapse(); waiting = true; } else { + pv.resetViews(); pv.setExpandedFraction(0); // just in case pv.setVisibility(View.GONE); pv.cancelPeek(); - pv.resetViews(); } } if (DEBUG) LOG("collapseAllPanels: animate=%s waiting=%s", animate, waiting);