Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 4155e2e1 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

Fix bug #10210182 CTS: android.widget.cts.TextViewTest#testDrawableResolution is failing on KLP

This issue has been actually revealed by a fix for bug #7034321 (Need Drawable RTL support)
where I identified an issue with Drawables resolution in TextView (was missing a call to
resetResolvedDrawables() and resolveDrawables()).

- add missing resetResolvedDrawables() and resolveDrawables() in TextView.setRelativeDrawablesIfNeeded()
- fix View.resolveDrawables():

this was a bit trycky as View.resolveDrawables() was wrongly supposing that the layout direction was
resolved and it could access View.getLayoutDirection() and could position the PFLAG2_DRAWABLE_RESOLVED
bit.

Dont forget that resolution of RTL properties (layoutDirection, Drawables ...) is happening in
View.measure() but in our case (TexView constructor) we still need to resolve the Drawables.

So now, be sure that we cannot resolve the Drawable if layout direction has not being resolved and the
raw layout direction is LAYOUT_DIRECTION_INHERIT.

But we can also "cheat" if the raw layout direction is LAYOUT_DIRECTION_LTR or LAYOUT_DIRECTION_RTL
or LAYOUT_DIRECTION_LOCALE as its resolution will give the same value :-)

Change-Id: I7a242d918697e1e1c2febf229e8edf1866b855be
parent 89d16f75
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