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 0b3f004acb)
This commit is contained in:
@@ -417,7 +417,7 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onHeightUpdate() {
|
public void onHeightUpdate() {
|
||||||
if (mParent == null || mMenuItems.size() == 0) {
|
if (mParent == null || mMenuItems.size() == 0 || mMenuContainer == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int parentHeight = mParent.getCollapsedHeight();
|
int parentHeight = mParent.getCollapsedHeight();
|
||||||
@@ -477,7 +477,7 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl
|
|||||||
|
|
||||||
private void setMenuLocation() {
|
private void setMenuLocation() {
|
||||||
boolean showOnLeft = mTranslation > 0;
|
boolean showOnLeft = mTranslation > 0;
|
||||||
if ((mIconsPlaced && showOnLeft == mOnLeft) || mSnapping
|
if ((mIconsPlaced && showOnLeft == mOnLeft) || mSnapping || mMenuContainer == null
|
||||||
|| !mMenuContainer.isAttachedToWindow()) {
|
|| !mMenuContainer.isAttachedToWindow()) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -57,4 +57,10 @@ public class NotificationMenuRowTest extends LeakCheckedTest {
|
|||||||
row.createMenu(null);
|
row.createMenu(null);
|
||||||
assertTrue(row.getMenuView() != null);
|
assertTrue(row.getMenuView() != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testResetUncreatedMenu() {
|
||||||
|
NotificationMenuRowPlugin row = new NotificationMenuRow(mContext);
|
||||||
|
row.resetMenu();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user