Apparently, this can cause an NPE when there are multiple displays.
Someone sent us
review.git.corp.google.com/c/platform/frameworks/base/+/2296938 and the problem will reoccur if we don't fix it in that code's new location.

Bug: 256539657
Test: presubmits
Change-Id: I2c08bb5606bc8af7f3da0f3034c58b5d57b1be0f
This commit is contained in:
Justin Weir
2022-12-13 16:14:40 -05:00
parent 74125f848d
commit 0553824a9a

View File

@@ -1290,8 +1290,10 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
}
private void onVerticalChanged(boolean isVertical) {
mCentralSurfacesOptionalLazy.get().ifPresent(statusBar ->
statusBar.getNotificationPanelViewController().setQsScrimEnabled(!isVertical));
Optional<CentralSurfaces> cs = mCentralSurfacesOptionalLazy.get();
if (cs.isPresent() && cs.get().getNotificationPanelViewController() != null) {
cs.get().getNotificationPanelViewController().setQsScrimEnabled(!isVertical);
}
}
private boolean onNavigationTouch(View v, MotionEvent event) {