From a6edc878293e49594a6aac7a0d0e41c7980ece07 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Tue, 26 Apr 2016 11:01:03 -0700 Subject: [PATCH] Fix a crash when setting vertical gear location and content view null When setting the vertical location of the gear we need the collapsed height of the parent, the parent might not be fully laid out so move setting the vertical location into onLayout instead Bug: 28390732 Change-Id: I7c1bf14a54e9f1ef0a693fa13e1a6533f5967631 --- .../android/systemui/statusbar/ExpandableNotificationRow.java | 3 +++ .../systemui/statusbar/NotificationSettingsIconRow.java | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java index caa15855d3759..beba4f26aaf69 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java @@ -1123,6 +1123,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); updateMaxHeights(); + if (mSettingsIconRow != null) { + mSettingsIconRow.updateVerticalLocation(); + } } private void updateMaxHeights() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSettingsIconRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSettingsIconRow.java index 060d8f473943c..4a1c451c1d28d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSettingsIconRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSettingsIconRow.java @@ -244,7 +244,6 @@ public class NotificationSettingsIconRow extends FrameLayout implements View.OnC } public void setIconLocation(boolean onLeft) { - updateVerticalLocation(); if ((mIconPlaced && onLeft == mOnLeft) || mSnapping || mParent == null || mGearIcon.getWidth() == 0) { // Do nothing