Android: Fix NPE in gesture navigation.
We evaluate gesture navigation enabled status every time Chrome app is resumed in order to deal with the system gesture navigation mode change while the app was in background. When testing, the parent view (CompositorViewHolder) is always in attached state when the activity is resumed, but it can happen that it is in detached state as reported in the bug. This caused an exception, since WindowInsets will be null in that state. This CL skips the check if the state is queried while the view is detached from its window. The only scenario that could potentially be affected is when user switched the system gesture navigation on the settings and resume the app later. But experiment shows that this re-creates ChromeActivity and attaches the views before resuming, and the mode change rarely happens in the field. So the change is not likely to be risky. Bug: 1045942 Change-Id: I7ac11796737b1f355786c65f309182b107c39f20 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2029547Reviewed-by:Ted Choc <tedchoc@chromium.org> Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org> Cr-Commit-Position: refs/heads/master@{#737552}
Showing
Please register or sign in to comment