Skip to content
Commit 5aa29ae5 authored by Mariia Sandrikova's avatar Mariia Sandrikova
Browse files

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 f20212ad.

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
parent fa71876c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment