Guard one more use of CentralSurfaces in NavBar

Also mark mPanelView in NavigationBarView nullable. All uses of it
already have null checks.

Bug: 254123249
Test: Barbet still looks OK.
Change-Id: I0b0c3017bd89f2d2261283573519301557096b2b
This commit is contained in:
Garfield Tan
2022-10-17 15:18:10 -07:00
parent 6b3114884e
commit 408a91a193
2 changed files with 4 additions and 1 deletions

View File

@@ -679,7 +679,9 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
public void onViewAttached() {
final Display display = mView.getDisplay();
mView.setComponents(mRecentsOptional);
mView.setComponents(mCentralSurfacesOptionalLazy.get().get().getPanelController());
if (mCentralSurfacesOptionalLazy.get().isPresent()) {
mView.setComponents(mCentralSurfacesOptionalLazy.get().get().getPanelController());
}
mView.setDisabledFlags(mDisabledFlags1, mSysUiFlagsContainer);
mView.setOnVerticalChangedListener(this::onVerticalChanged);
mView.setOnTouchListener(this::onNavigationTouch);

View File

@@ -148,6 +148,7 @@ public class NavigationBarView extends FrameLayout {
private NavigationBarInflaterView mNavigationInflaterView;
private Optional<Recents> mRecentsOptional = Optional.empty();
@Nullable
private NotificationPanelViewController mPanelView;
private RotationContextButton mRotationContextButton;
private FloatingRotationButton mFloatingRotationButton;