Prevent NullPointerException in ActivityRecord when in Size Compat Mode
When checking if a translucent activity strategy was in place we
also checked if the current activity bounds was matching the
bounds of the parent. When the translucent activities strategy
is in place, ActivityRecord#matchParentBounds() can return true
making LetterboxUiController#hasInheritedLetterboxBehavior return
false. When this happens it's possible that
ActivityRecord#getCompatDisplayInsets() returns null and then
the NullPointerException.
This CL also adds additional checks to prevent NullPointerException
also reducing ActivityRecord#getCompatDisplayInsets() invocation using local
variables.
Fixes: 271427810
Test: Existing presubmit tests.
Change-Id: I10591cd59057f7dc2e03653747bd541c66f23d4a
2 files changed