From 8ea2d5f72d8a5e0c68344496ed0b082772874954 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Wed, 20 Apr 2016 17:10:40 -0700 Subject: [PATCH] Fixed a crash when the heads up content view was null Change-Id: I02c47eb0f4bcc3620103882e34b079aa83790a44 Fixes: 28301534 --- .../systemui/statusbar/NotificationContentView.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java index 491ffde8071f7..eba393bfb7c63 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java @@ -834,10 +834,14 @@ public class NotificationContentView extends FrameLayout { public void updateExpandButtons(boolean expandable) { mExpandable = expandable; // if the expanded child has the same height as the collapsed one we hide it. - if (mExpandedChild != null && mExpandedChild.getHeight() != 0 && - ((mIsHeadsUp && mExpandedChild.getHeight() == mHeadsUpChild.getHeight()) || - (!mIsHeadsUp && mExpandedChild.getHeight() == mContractedChild.getHeight()))) { - expandable = false; + if (mExpandedChild != null && mExpandedChild.getHeight() != 0) { + if ((!mIsHeadsUp || mHeadsUpChild == null)) { + if (mExpandedChild.getHeight() == mContractedChild.getHeight()) { + expandable = false; + } + } else if (mExpandedChild.getHeight() == mHeadsUpChild.getHeight()) { + expandable = false; + } } if (mExpandedChild != null) { mExpandedWrapper.updateExpandability(expandable, mExpandClickListener);