Skip updating nav bar if it was destroyed

- Since device config updates are posted, there can be
  a queued update after we remove the nav bar, which
  will reference a null bar

Bug: 210713030
Test: Haven't been able to trigger the actual NPE
Change-Id: I05f1cb6e2a97808ad05b5aaaa046689df04995e1
This commit is contained in:
Winson Chung
2022-02-19 01:00:42 +00:00
parent b70d7493c6
commit 2a1792ea49

View File

@@ -440,7 +440,9 @@ public class NavigationBar implements View.OnAttachStateChangeListener,
mHomeButtonLongPressDurationMs = Optional.of(
properties.getLong(HOME_BUTTON_LONG_PRESS_DURATION_MS, 0)
).filter(duration -> duration != 0);
reconfigureHomeLongClick();
if (mNavigationBarView != null) {
reconfigureHomeLongClick();
}
}
}
};