Prevent null references when updating state
Certain external calls (such as GlobalActionsComponent) will make calls to updateState which may happen without central surfaces being registered to this component. This can be prevented by checking for registration prior to update. This is more of a short term patch. In the long term, the StatusBarKeyguardViewManager is planned to be refactored/removed so additional effort or refactoring now seems unessesary. Bug: 249086825 Test: manual Change-Id: Ica4043470e13a239f0792a10e807dd1a899f5f85
This commit is contained in:
@@ -194,6 +194,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
protected CentralSurfaces mCentralSurfaces;
|
||||
private NotificationPanelViewController mNotificationPanelViewController;
|
||||
private BiometricUnlockController mBiometricUnlockController;
|
||||
private boolean mCentralSurfacesRegistered;
|
||||
|
||||
private View mNotificationContainer;
|
||||
|
||||
@@ -312,6 +313,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
mNotificationContainer = notificationContainer;
|
||||
mKeyguardMessageAreaController = mKeyguardMessageAreaFactory.create(
|
||||
centralSurfaces.getKeyguardMessageArea());
|
||||
mCentralSurfacesRegistered = true;
|
||||
|
||||
registerListeners();
|
||||
}
|
||||
@@ -1007,6 +1009,9 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
};
|
||||
|
||||
protected void updateStates() {
|
||||
if (!mCentralSurfacesRegistered) {
|
||||
return;
|
||||
}
|
||||
boolean showing = mShowing;
|
||||
boolean occluded = mOccluded;
|
||||
boolean bouncerShowing = mBouncer.isShowing();
|
||||
|
||||
Reference in New Issue
Block a user