Refine getSystemWindowInsets when compatIgnoreVisibility is true

Before this CL, WindowInsets#getSystemWindowInsets would only return the
vales in mTypeMaxInsetsMap (except IME) if mCompatIgnoreVisibility is
true. However, the caller might add insets to mTypeInsetsMap via
WindowInsets#replaceSystemWindowInsets. So when mCompatIgnoreVisibility
is true, anyone (including the framework) cannot get the insets added
previously from getSystemWindowInsets.

Before commit 68d2b2f4308df4606fb9f1eb346ba36a2fb15b37,
mCompatIgnoreVisibility would be cleared unexpectedly by Builder. So
this issue was not discovered.

This CL returns the larger values between typeInsetsMap and
typeMaxInsetsMap from getSystemWindowInsets when mCompatIgnoreVisibility
is true.

Fix: 428536047
Bug: 429707181
Flag: EXEMPT bug fix
Test: atest WindowInsetsTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:642b9026613812f13907b2c15cf4fc37088fad9f)
Merged-In: Ie965457279b3e5dd78c73c6995e678654894094a
Change-Id: Ie965457279b3e5dd78c73c6995e678654894094a
2 files changed