diff options
| author | 2016-10-13 00:37:27 +0000 | |
|---|---|---|
| committer | 2016-10-13 00:37:29 +0000 | |
| commit | 0bdfc7be66f67e71b24869f69b26b31ece5a7bb8 (patch) | |
| tree | f970ba1e824d39c2ce9d5ca7dc2fee764d73ee78 | |
| parent | d517c3c16bec8f1a7a321267cde82053844851a5 (diff) | |
| parent | 3e779844346ca7add55f0180e33978f52be9f526 (diff) | |
Merge "Fixed a bug where the system could crash when expanding" into nyc-mr1-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index bc89db221511..f3e5c94be032 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -1056,7 +1056,7 @@ public class NotificationStackScrollLayout extends ViewGroup @Override public int getMaxExpandHeight(ExpandableView view) { int maxContentHeight = view.getMaxContentHeight(); - if (view.isSummaryWithChildren()) { + if (view.isSummaryWithChildren() && view.getParent() == this) { // Faking a measure with the group expanded to simulate how the group would look if // it was. Doing a calculation here would be highly non-trivial because of the // algorithm @@ -1071,8 +1071,11 @@ public class NotificationStackScrollLayout extends ViewGroup row.getStatusBarNotification()); mGroupExpandedForMeasure = false; row.setForceUnlocked(false); - int height = mCurrentStackScrollState.getViewStateForView(view).height; - return Math.min(height, maxContentHeight); + StackViewState viewState = mCurrentStackScrollState.getViewStateForView(view); + if (viewState != null) { + // The view could have been removed + return Math.min(viewState.height, maxContentHeight); + } } return maxContentHeight; } |