Add a null check to prevent NPE when status bar isn't inflated

It looks like occasionally touches are being handled as if they're
being proxied from status bar to shade before status bar view is
inflated, causing an NPE here.

Bug: 280086782
Test: N/A
Change-Id: I4b02287d7af013ab5358584d89e7eeac31f1e7f5
This commit is contained in:
Shawn Lee
2023-05-05 14:31:37 -07:00
parent 8977208b9d
commit ce8997fc0b

View File

@@ -205,8 +205,11 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
// TODO move this logic to message queue
mCentralSurfacesOptionalLazy.get().ifPresent(centralSurfaces -> {
if (event.getActionMasked() == ACTION_DOWN) {
centralSurfaces.getShadeViewController()
.startExpandLatencyTracking();
ShadeViewController shadeViewController =
centralSurfaces.getShadeViewController();
if (shadeViewController != null) {
shadeViewController.startExpandLatencyTracking();
}
}
mHandler.post(() -> {
int action = event.getActionMasked();