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

Skip to content
Commit 9ef68bd5 authored by maxwelb's avatar maxwelb Committed by Eric Erfanian
Browse files

Remove letter tile's manual asset caching

In b/63143138 we discovered an issue with the LetterTileDrawable code.
The class has static fields that are shared across both the main and
background threads, which aren't threadsafe. We attempted to make the
code threadsafe in cl/160696979, but that ended up causing issues as
well.

This CL takes a different approach. Rather than trying to make the code
threadsafe, it instead removes the shared fields and makes them final
and initialized in the constructor. This is inherently threadsafe since
threads cannot interact with the object until it is constructed.

Now that the objects aren't shared, we would potentially use more
memory, since each LetterTileDrawable will now hold onto an instance of
the formally shared object. This was not determined to be an issue
in practice, see the data and conclusion in
(go/lettertiledrawable-caching).

Bug: 63143138
Test: LetterTileDrawableTest (can't verify everything :/ )
PiperOrigin-RevId: 161432711
Change-Id: I443bef01ffac405f5e14e9d981ce1d5a8f3f8fec
parent 503b8f44
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