Adjust smallestScreenWidthDp for letterbox
By definition, smallestScreenWidthDp is the smallest value of both screenWidthDp and screenHeightDp in both portrait and landscape orientations. When a different value is reported in smallestScreenWidthDp, the app can load incorrect layout.
Also, move updateCompatDisplayInsets to ensureActivityConfiguration to guarantee that it is called after the full config is updated in ConfigurationContainer#onConfigurationChanged
Revert "Revert "Adjust smallestScreenWidthDp for letterbox""
This reverts commit f20212adb868916170756b0300d3e21babba8a31.
Reason for revert: Fixing the problem that led to the original revert: in the original CL, smallestScreenWidthDp for activities eligible for size-compat mode wasn't guaranteed to be constant and equal to a minimum between screenWidthDp and screenHeightDp because computeConfigResourceOverrides wasn't triggered from ActivityRecord with mCompatDisplayInsets passed as a parameter when activity was cold started in a configuration that didn't require letterboxing.
Test: atest WmTests:SizeCompatTests
Fix: 232406936
Change-Id: Ib4b88360312795097e33d422c444c0e855a06a7b
3 files changed