ResolverDrawerLayout: unify mCollapsibleHeight calculation.
(an ag/20419209 cherry-pick)
mCollapsibleHeight was calculated differently in two places: in
onMeasure() and in setCollapsibleHeightReserved() methods. The latter is
updated to use the same logic as the former.
There was two particular aspects of the onMeasure() logic:
- It calculated mCollapsibleHeight and mUncollapsibleHeight so the sum
of the two yields the total children height;
- mCollapsibleHeight was calculated based on the total childrens height.
Thus a correct mCollapsibleHeight calculation in the
setCollapsibleHeightReserved() method would need to know the total
children height and maintain the invariant that mCollapsibleHeight +
mUncollapsibleHeight would yield that height.
Instead of deriving the total children height as a sum of
mCollapsibleHeight + mUncollapsibleHeight, a new field, mHeightUsed, is
added to store the total children height and mUncollapsibleHeight is
deleted. This way we don’t have to also update mUncollapsibleHeight in
setCollapsibleHeightReserved() plus mUncollapsibleHeight was always used
as a part of the sum mCollapsibleHeight + mUncollapsibleHeight so it is
a natural replacement.
Flag: IntentResolver package entirely behind the CHOOSER_UNBUNDLED which is in teamfood
Bug: 256869196
Test: reproduce the issue in a separate test environment, make sure
that the change acutally fixes it
Test: manual Chooser smoke test
Test: manual Resolver smoke test
Test: atest FrameworksCoreTests:ChooserActivityTest
Test: atest FrameworksCoreTests:ResolverActivityTest
Change-Id: Id169bd1c4b9f7270d75baab2e5e3841b76ab00e6
2 files changed