commit | ef9a16202d5933b05f938e98454c6a053009aeb3 | [log] [tgz] |
---|---|---|
author | Mady Mellor <madym@google.com> | Wed Jun 28 18:08:52 2017 +0000 |
committer | android-build-merger <android-build-merger@google.com> | Wed Jun 28 18:08:52 2017 +0000 |
tree | 324227893d4d66801f29ff522f7fea47ea632889 | |
parent | c1bf6505c89381e37f8510a5688b859200f726b1 [diff] | |
parent | 104be2e0196fec5198b866834d19a26e938d4afc [diff] |
If the menu hasn't been created yet don't do things with it am: 104be2e019 Change-Id: I670206eb1da007b1eeea5f022124a352b0644b6a
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java index c09da21..bd4a1df 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java
@@ -417,7 +417,7 @@ @Override public void onHeightUpdate() { - if (mParent == null || mMenuItems.size() == 0) { + if (mParent == null || mMenuItems.size() == 0 || mMenuContainer == null) { return; } int parentHeight = mParent.getCollapsedHeight(); @@ -477,7 +477,7 @@ private void setMenuLocation() { boolean showOnLeft = mTranslation > 0; - if ((mIconsPlaced && showOnLeft == mOnLeft) || mSnapping + if ((mIconsPlaced && showOnLeft == mOnLeft) || mSnapping || mMenuContainer == null || !mMenuContainer.isAttachedToWindow()) { // Do nothing return;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationMenuRowTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationMenuRowTest.java index e0d8042..4aa9877 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationMenuRowTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationMenuRowTest.java
@@ -57,4 +57,10 @@ row.createMenu(null); assertTrue(row.getMenuView() != null); } + + @Test + public void testResetUncreatedMenu() { + NotificationMenuRowPlugin row = new NotificationMenuRow(mContext); + row.resetMenu(); + } }