From 0c87f87008a5bbfc00dd82b27cad196131485429 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 13 Dec 2016 13:01:20 -0800 Subject: [PATCH] Fixed a bug where systemui could crash Because the shelf could be the only visible view and an animation happened, it could crash. Test: Add a notification and remove it while the yTranslation changes Change-Id: Icf47e91075437f129ad9fd7c3f206e864178a753 Fixes: 33484955 --- .../systemui/statusbar/stack/StackStateAnimator.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackStateAnimator.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackStateAnimator.java index 1f29b4fd7d917..37808fef4a29d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackStateAnimator.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackStateAnimator.java @@ -253,7 +253,13 @@ public class StackStateAnimator { View viewAfterChangingView = noNextView ? mHostLayout.getLastChildNotGone() : event.viewAfterChangingView; - + if (viewAfterChangingView == null) { + // This can happen when the last view in the list is removed. + // Since the shelf is still around and the only view, the code still goes + // in here and tries to calculate the delay for it when case its properties + // have changed. + continue; + } int nextIndex = finalState .getViewStateForView(viewAfterChangingView).notGoneIndex; if (ownIndex >= nextIndex) {