diff options
| author | 2017-06-20 17:18:53 -0700 | |
|---|---|---|
| committer | 2017-06-28 15:34:36 +0000 | |
| commit | 104be2e0196fec5198b866834d19a26e938d4afc (patch) | |
| tree | 379cc08c976880acf6c24027562ef3be83fafcf4 | |
| parent | f36a995424b629bcd9bb1c0e65b8e572e01d0dfb (diff) | |
If the menu hasn't been created yet don't do things with it
Test: runtest systemui
Fixes: 62594598
Change-Id: I1050e2b2bf1ece960d19ad13cb6a9bf71512db57
(cherry picked from commit 0b3f004acbb0eef38ee5e8d920e934f7ab2f7cde)
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java | 4 | ||||
| -rw-r--r-- | packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationMenuRowTest.java | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMenuRow.java index c09da2183076..bd4a1df246f3 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 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl @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 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl 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 e0d8042238d2..4aa987738572 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 @@ public class NotificationMenuRowTest extends LeakCheckedTest { row.createMenu(null); assertTrue(row.getMenuView() != null); } + + @Test + public void testResetUncreatedMenu() { + NotificationMenuRowPlugin row = new NotificationMenuRow(mContext); + row.resetMenu(); + } } |