Don't NPE in PanelView

AUPT seems to have found that this can happen sometimes;
PanelView#notifyBarPanelExpansionChanged() gets called before mBar is
set. So just don't call methods on it in that case

Fixes: 124002167
Test: atest SystemUITests
Change-Id: I137b416c3cfabd8f041c4867b4a4f25a483f00d4
This commit is contained in:
Evan Laird
2019-03-01 15:12:50 -05:00
parent ae3b4c44fb
commit 0de26b05be

View File

@@ -1172,9 +1172,11 @@ public abstract class PanelView extends FrameLayout {
}
protected void notifyBarPanelExpansionChanged() {
mBar.panelExpansionChanged(mExpandedFraction, mExpandedFraction > 0f
|| mPeekAnimator != null || mInstantExpanding || isPanelVisibleBecauseOfHeadsUp()
|| mTracking || mHeightAnimator != null);
if (mBar != null) {
mBar.panelExpansionChanged(mExpandedFraction, mExpandedFraction > 0f
|| mPeekAnimator != null || mInstantExpanding
|| isPanelVisibleBecauseOfHeadsUp() || mTracking || mHeightAnimator != null);
}
if (mExpansionListener != null) {
mExpansionListener.accept(mExpandedFraction, mTracking);
}